438 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			438 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Data;
							 | 
						|||
| 
								 | 
							
								using System.Data.SqlClient;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using BLL;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace FineUIPro.Web.HJGL.WeldingManage
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public partial class WeldReportItemEdit : PageBase
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        #region 定义项
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 单位主键
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public string UnitId
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return (string)ViewState["UnitId"];
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ViewState["UnitId"] = value;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 装置主键
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public string InstallationId
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return (string)ViewState["InstallationId"];
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ViewState["InstallationId"] = value;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 焊口主键
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public string Jot_ID
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return (string)ViewState["Jot_ID"];
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ViewState["Jot_ID"] = value;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 日报主键
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public string DReportID
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return (string)ViewState["DReportID"];
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ViewState["DReportID"] = value;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 项目
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public string ProjectId
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return (string)ViewState["ProjectId"];
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ViewState["ProjectId"] = value;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 被选择项列表
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public List<string> SelectedList
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return (List<string>)ViewState["SelectedList"];
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ViewState["SelectedList"] = value;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 加载页面
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 加载页面
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void Page_Load(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            if (!IsPostBack)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                this.SelectedList = new List<string>();
							 | 
						|||
| 
								 | 
							
								                //this.NoSelectedList = new List<string>();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                string strList = Request.Params["strList"];
							 | 
						|||
| 
								 | 
							
								                List<string> list = Funs.GetStrListByStr(strList, '|');
							 | 
						|||
| 
								 | 
							
								                if (list.Count() == 4)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    this.ProjectId = list[0];
							 | 
						|||
| 
								 | 
							
								                    this.UnitId = list[1];
							 | 
						|||
| 
								 | 
							
								                    this.DReportID = list[2];
							 | 
						|||
| 
								 | 
							
								                    this.InstallationId = list[3];
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                    BLL.WorkAreaService.InitWorkAreaProjectInstallUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.InstallationId, this.UnitId, true);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                    ///盖面焊工
							 | 
						|||
| 
								 | 
							
								                    drpCellWelder.DataTextField = "Text";
							 | 
						|||
| 
								 | 
							
								                    drpCellWelder.DataValueField = "Value";
							 | 
						|||
| 
								 | 
							
								                    drpCellWelder.DataSource = BLL.WelderService.GetWelderCodeListByProjectIdAndUnitId(this.CurrUser.LoginProjectId, this.UnitId);
							 | 
						|||
| 
								 | 
							
								                    drpCellWelder.DataBind();
							 | 
						|||
| 
								 | 
							
								                    Funs.FineUIPleaseSelect(this.drpCellWelder);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                    ///打底焊工
							 | 
						|||
| 
								 | 
							
								                    drpFloorWelder.DataTextField = "Text";
							 | 
						|||
| 
								 | 
							
								                    drpFloorWelder.DataValueField = "Value";
							 | 
						|||
| 
								 | 
							
								                    drpFloorWelder.DataSource = BLL.WelderService.GetWelderCodeListByProjectIdAndUnitId(this.CurrUser.LoginProjectId, this.UnitId);
							 | 
						|||
| 
								 | 
							
								                    drpFloorWelder.DataBind();
							 | 
						|||
| 
								 | 
							
								                    //this.BindGrid();
							 | 
						|||
| 
								 | 
							
								                    Funs.FineUIPleaseSelect(this.drpFloorWelder);
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                //this.InitTreeMenu();//加载树
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 加载树
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 加载树
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        private void InitTreeMenu()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.tvControlItem.Nodes.Clear();
							 | 
						|||
| 
								 | 
							
								            TreeNode rootNode = new TreeNode();
							 | 
						|||
| 
								 | 
							
								            rootNode.Text = "管线号";
							 | 
						|||
| 
								 | 
							
								            rootNode.NodeID = "0";
							 | 
						|||
| 
								 | 
							
								            rootNode.Expanded = true;
							 | 
						|||
| 
								 | 
							
								            this.tvControlItem.Nodes.Add(rootNode);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            var iso = (from x in Funs.DB.PW_IsoInfo where x.ProjectId == this.ProjectId && x.UnitId == this.UnitId orderby x.ISO_IsoNo select x).ToList();
							 | 
						|||
| 
								 | 
							
								            if (this.drpWorkArea.SelectedValue != BLL.Const._Null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                iso = (from x in iso where x.WorkAreaId == this.drpWorkArea.SelectedValue orderby x.ISO_IsoNo select x).ToList();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            if (!string.IsNullOrEmpty(this.txtIsono.Text))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                iso = (from x in iso where x.ISO_IsoNo.Contains(this.txtIsono.Text.Trim()) orderby x.ISO_IsoNo select x).ToList();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            foreach (var item in iso)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                TreeNode newNode = new TreeNode();
							 | 
						|||
| 
								 | 
							
								                newNode.Text = item.ISO_IsoNo;
							 | 
						|||
| 
								 | 
							
								                newNode.NodeID = item.ISO_ID;
							 | 
						|||
| 
								 | 
							
								                newNode.ToolTip = item.ISO_IsoNo;
							 | 
						|||
| 
								 | 
							
								                newNode.EnableClickEvent = true;
							 | 
						|||
| 
								 | 
							
								                rootNode.Nodes.Add(newNode);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 数据绑定
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 数据绑定
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        private void BindGrid()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            string isoId = this.tvControlItem.SelectedNodeID;
							 | 
						|||
| 
								 | 
							
								            string strSql = @"SELECT distinct CONVERT(INT,dbo.Fun_GetParseInt(jot.JOT_JointNo) ) [index],jot.JOT_ID,jot.JOT_JointNo,jot.ISO_IsoNo,jot.JOT_JointDesc,
							 | 
						|||
| 
								 | 
							
								                                     jot.STE_Name1,jot.STE_Name2
							 | 
						|||
| 
								 | 
							
								                              FROM dbo.View_JointInfo jot
							 | 
						|||
| 
								 | 
							
								                              WHERE (jot.DReportID IS NULL OR jot.DReportID=@DReportID)
							 | 
						|||
| 
								 | 
							
									                                AND jot.ProjectId=@ProjectId AND jot.ISO_ID=@ISO_ID";
							 | 
						|||
| 
								 | 
							
								            if (!string.IsNullOrEmpty(txtJOT_JointNo.Text))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                strSql += " AND  jot.JOT_JointNo like '%" + txtJOT_JointNo.Text + "%'";
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            var welder = WelderService.GetWelderByCode(this.CurrUser.LoginProjectId, this.drpCellWelder.SelectedValue);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            if (welder != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                var items = (from x in Funs.DB.BS_WeldMethodItem where x.WED_ID == welder.WED_ID select x.WME_ID).FirstOrDefault();
							 | 
						|||
| 
								 | 
							
								                if (items != null)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += " AND jot.WME_ID in (select WME_ID from BS_WeldMethodItem where WED_ID='" + welder.WED_ID + "')";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(welder.JOT_Sch) && "1" == welder.JOT_Sch)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += " AND jot.JOT_Sch < 24.0 ";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(welder.Steels))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += "AND  jot.MaterialId in (select  MaterialId from Base_Material where SteelType in (" + welder.Steels + "))";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            List<SqlParameter> listStr = new List<SqlParameter>();
							 | 
						|||
| 
								 | 
							
								            listStr.Add(new SqlParameter("@DReportID", this.DReportID));
							 | 
						|||
| 
								 | 
							
								            listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
							 | 
						|||
| 
								 | 
							
								            listStr.Add(new SqlParameter("@ISO_ID", isoId));
							 | 
						|||
| 
								 | 
							
								            strSql += " ORDER BY [index]";
							 | 
						|||
| 
								 | 
							
								            SqlParameter[] parameter = listStr.ToArray();
							 | 
						|||
| 
								 | 
							
								            DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            string jotIds = Request.Params["jotIds"];
							 | 
						|||
| 
								 | 
							
								            if (!string.IsNullOrEmpty(jotIds))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                string[] jots = jotIds.Split('|');
							 | 
						|||
| 
								 | 
							
								                foreach (string jotId in jots)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    DataRow r = dt.Select("JOT_ID='" + jotId + "'").FirstOrDefault();
							 | 
						|||
| 
								 | 
							
								                    if (r != null)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        dt.Rows.Remove(r);
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    //Model.HJGL_SpRpWeldReportItem item = toDoMatterList.FirstOrDefault(e => e.JOT_ID == jotId);
							 | 
						|||
| 
								 | 
							
								                    //if (item != null)
							 | 
						|||
| 
								 | 
							
								                    //{
							 | 
						|||
| 
								 | 
							
								                    //    toDoMatterList.Remove(item);
							 | 
						|||
| 
								 | 
							
								                    //}
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            if (dt != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                foreach (DataRow row in dt.Rows)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    try
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        row["index"] = int.Parse(System.Text.RegularExpressions.Regex.Replace(row["JOT_JointNo"].ToString(), @"[^0-9]+", ""));
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    catch (Exception e)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        row["index"] = 0;
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //DataTable tb = this.LINQToDataTable(toDoMatterList);
							 | 
						|||
| 
								 | 
							
								            // 2.获取当前分页数据 
							 | 
						|||
| 
								 | 
							
								            Grid1.RecordCount = dt.Rows.Count;
							 | 
						|||
| 
								 | 
							
								            var table = this.GetPagedDataTable(Grid1, dt);
							 | 
						|||
| 
								 | 
							
								            table = GetFilteredTable(Grid1.FilteredData, table);
							 | 
						|||
| 
								 | 
							
								            Grid1.DataSource = table;
							 | 
						|||
| 
								 | 
							
								            Grid1.DataBind();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //string[] arr = new string[this.Grid1.Rows.Count];
							 | 
						|||
| 
								 | 
							
								            //int a = 0;
							 | 
						|||
| 
								 | 
							
								            //for (int i = 0; i < this.Grid1.Rows.Count; i++)
							 | 
						|||
| 
								 | 
							
								            //{
							 | 
						|||
| 
								 | 
							
								            //    string rowId = this.Grid1.Rows[i].DataKeys[0].ToString();
							 | 
						|||
| 
								 | 
							
								            //    if (jotIds.Contains(rowId))
							 | 
						|||
| 
								 | 
							
								            //    {
							 | 
						|||
| 
								 | 
							
								            //        arr[a] = rowId;
							 | 
						|||
| 
								 | 
							
								            //    }
							 | 
						|||
| 
								 | 
							
								            //    a++;
							 | 
						|||
| 
								 | 
							
								            //}
							 | 
						|||
| 
								 | 
							
								            //Grid1.SelectedRowIDArray = arr;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 管线查询
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 查询
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void Tree_TextChanged(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.InitTreeMenu();
							 | 
						|||
| 
								 | 
							
								            this.BindGrid();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 点击TreeView
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 点击TreeView
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            string[] selectRowId = Grid1.SelectedRowIDArray;
							 | 
						|||
| 
								 | 
							
								            for (int i = 0; i < this.Grid1.Rows.Count; i++)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                string rowId = this.Grid1.Rows[i].DataKeys[0].ToString();
							 | 
						|||
| 
								 | 
							
								                if (selectRowId.Contains(rowId))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    SelectedList.Add(rowId);
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                //else
							 | 
						|||
| 
								 | 
							
								                //{
							 | 
						|||
| 
								 | 
							
								                //    NoSelectedList.Add(rowId);
							 | 
						|||
| 
								 | 
							
								                //}
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            this.BindGrid();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region DropDownList下拉事件
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 盖面、打底焊工一致
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void drpCellWelder_OnSelectedIndexChanged(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.drpFloorWelder.SelectedValue = this.drpCellWelder.SelectedValue;
							 | 
						|||
| 
								 | 
							
								            this.BindGrid();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 排序
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 排序
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void Grid1_Sort(object sender, GridSortEventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.BindGrid();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        //protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
							 | 
						|||
| 
								 | 
							
								        //{
							 | 
						|||
| 
								 | 
							
								        //    BindGrid();
							 | 
						|||
| 
								 | 
							
								        //}
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        protected void txtJOT_JointNo_TextChanged(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            string[] selectRowId = Grid1.SelectedRowIDArray;
							 | 
						|||
| 
								 | 
							
								            for (int i = 0; i < this.Grid1.Rows.Count; i++)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                string rowId = this.Grid1.Rows[i].DataKeys[0].ToString();
							 | 
						|||
| 
								 | 
							
								                if (selectRowId.Contains(rowId))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    SelectedList.Add(rowId);
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                //else
							 | 
						|||
| 
								 | 
							
								                //{
							 | 
						|||
| 
								 | 
							
								                //    NoSelectedList.Add(rowId);
							 | 
						|||
| 
								 | 
							
								                //}
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            BindGrid();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 提交按钮
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 提交按钮
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void btnAccept_Click(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            if (this.drpCellWelder.SelectedValue != Const._Null && this.drpFloorWelder.SelectedValue != Const._Null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                string itemsString = string.Empty;
							 | 
						|||
| 
								 | 
							
								                string[] selectRowId = Grid1.SelectedRowIDArray;
							 | 
						|||
| 
								 | 
							
								                for (int i = 0; i < this.Grid1.Rows.Count; i++)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    string rowId = this.Grid1.Rows[i].DataKeys[0].ToString();
							 | 
						|||
| 
								 | 
							
								                    if (selectRowId.Contains(rowId))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        SelectedList.Add(rowId);
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                string jotIds = Request.Params["jotIds"];
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(jotIds))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    string[] jots = jotIds.Split('|');
							 | 
						|||
| 
								 | 
							
								                    foreach (string jotId in jots)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        SelectedList.Add(jotId);
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                var welders = from x in Funs.DB.BS_Welder where x.ProjectId == this.CurrUser.LoginProjectId && x.WED_Unit == this.UnitId select x;
							 | 
						|||
| 
								 | 
							
								                string cellWelderId = string.Empty, floorWelderId = string.Empty;
							 | 
						|||
| 
								 | 
							
								                var cellWelder = welders.FirstOrDefault(x => x.WED_Code == this.drpCellWelder.SelectedValue);
							 | 
						|||
| 
								 | 
							
								                if (cellWelder != null)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    cellWelderId = cellWelder.WED_ID;
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                var floorWelder = welders.FirstOrDefault(x => x.WED_Code == this.drpFloorWelder.SelectedValue);
							 | 
						|||
| 
								 | 
							
								                if (floorWelder != null)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    floorWelderId = floorWelder.WED_ID;
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                itemsString = cellWelderId + "|" + floorWelderId + "#";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                foreach (var item in SelectedList)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    if (!itemsString.Contains(item))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        itemsString += item + "|";
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(itemsString)
							 | 
						|||
| 
								 | 
							
								                        + ActiveWindow.GetHidePostBackReference());
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            else
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ShowNotify("请选择焊工!", MessageBoxIcon.Warning);
							 | 
						|||
| 
								 | 
							
								                return;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |