Example #1
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList      pkArray = null;
            ProcessFlowBLL bll     = null;

            try
            {
                bll = BLLFactory.CreateBLL <ProcessFlowBLL>();

                pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0);

                foreach (object key in pkArray)
                {
                    if (!bll.HasProcessInfo(key.ToString()))
                    {
                        bll.DeleteProcessFlow(new ProcessFlow {
                            PID = key.ToString()
                        });
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('选中的工艺有工序,不能被删除');", true);
                    }
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            ProcessFlow    info = new ProcessFlow();
            ProcessFlowBLL bll  = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll = BLLFactory.CreateBLL <ProcessFlowBLL>();

                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.PID        = this.hiID.Value;
                    bll.Update(info);
                }

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        private void BindData()
        {
            string         id   = Request.QueryString["id"];
            ProcessFlowBLL bll  = null;
            ProcessFlow    info = new ProcessFlow();

            try
            {
                bll = BLLFactory.CreateBLL <ProcessFlowBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.PID = id;
                    info     = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.PID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                }
                else
                {
                    info = new ProcessFlow();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        private void BindProcessFlowList()
        {
            ProcessFlowBLL     bll   = null;
            List <ProcessFlow> array = null;

            bll   = BLLFactory.CreateBLL <ProcessFlowBLL>();
            array = bll.GetList();

            this.PRID.DataSource = array;
            this.PRID.DataBind();
        }
Example #5
0
        private void BindData()
        {
            ProcessFlowBLL bll       = null;
            DataPage       dp        = new DataPage();
            ProcessFlow    condition = new ProcessFlow();
            string         eID       = Request.QueryString["eID"];

            if (!string.IsNullOrEmpty(eID))
            {
                if (eID.Split('|')[1] == "F")
                {
                    condition.FACTORYPID = eID.Split('|')[0];
                }
                else
                {
                    condition.PRODUCTLINEPID = eID.Split('|')[0];
                }
            }
            try
            {
                bll             = BLLFactory.CreateBLL <ProcessFlowBLL>();
                condition.PCODE = this.PCODE.Text;
                condition.PNAME = this.PNAME.Text;

                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <ProcessFlow> list = dp.Result as List <ProcessFlow>;
                this.GvList.DataSource = list;
                this.GvList.DataBind();

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString());

                    (this.GvList.Rows[i].Cells[4].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #6
0
        /// <summary>
        /// 获取仓库树数据源
        /// </summary>
        /// <returns></returns>
        public string GetWSList()
        {
            List <TreeNodeResult> list   = new List <TreeNodeResult>();
            FactoryInfoBLL        bllF   = null;
            ProcessFlowBLL        bllP   = null;
            List <FactoryInfo>    arrayF = null;
            List <ProcessFlow>    arrayP = null;

            try
            {
                bllF   = BLLFactory.CreateBLL <FactoryInfoBLL>();
                bllP   = BLLFactory.CreateBLL <ProcessFlowBLL>();
                arrayF = bllF.GetList();
                arrayP = bllP.GetList();
                TreeNodeResult rootNode = new TreeNodeResult();
                rootNode.Tid   = "";
                rootNode.Ttext = "工厂/工艺流程";
                foreach (FactoryInfo infoF in arrayF)
                {
                    TreeNodeResult node = new TreeNodeResult();
                    node.Tid   = infoF.PID + "|F";
                    node.Ttext = infoF.PCODE + "|" + infoF.PNAME;
                    rootNode.AddchildNode(node);
                    List <ProcessFlow> plines = arrayP.Where(o => o.FACTORYPID == infoF.PID).ToList();
                    foreach (ProcessFlow infoP in plines)
                    {
                        TreeNodeResult nodeP = new TreeNodeResult();
                        nodeP.Tid   = infoP.PID + "|P";
                        nodeP.Ttext = infoP.PCODE + "|" + infoP.PNAME;
                        node.AddchildNode(nodeP);
                    }
                }
                list.Add(rootNode);
                return(TreeNodeResult.GetResultJosnS(list.ToArray()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }