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

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

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

                foreach (object key in pkArray)
                {
                    if (!bll.HasProducePlan(key.ToString()))
                    {
                        bll.DeleteProductInfo(new ProductInfo {
                            PID = key.ToString()
                        });
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('选中的产品被产品计划使用过,不能被删除');", true);
                    }
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList   pkArray = null;
            WHClientBLL bll     = null;

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

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

                foreach (object key in pkArray)
                {
                    bll.Delete(new WHClient {
                        ID = key.ToString()
                    });
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList      pkArray = null;
            ProcessInfoBLL bll     = null;

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

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

                foreach (object key in pkArray)
                {
                    bll.DeleteProcessInfo(new Manage.Entity.MES.ProcessInfo {
                        PID = key.ToString()
                    });
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList     pkArray = null;
            WarehouseBLL  bll     = null;
            List <string> msgList = new List <string>();

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

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

                if (pkArray.Count == 0)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','请选择要删除的记录');", true);
                    return;
                }

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    CheckBox cbxSelect = this.GvList.Rows[i].Cells[0].FindControl("cbxSelect") as CheckBox;

                    if (cbxSelect.Checked == false)
                    {
                        continue;
                    }

                    Warehouse site = new Warehouse();
                    site.ID          = this.GvList.DataKeys[i]["ID"].ToString();
                    site.Description = this.GvList.Rows[i].Cells[1].Text;

                    //判断是否已使用
                    bool r = bll.IsUse(site);
                    if (r == true)
                    {
                        msgList.Add(site.Description);
                        continue;
                    }

                    //删除
                    bll.Delete(site);
                }
                string msg = string.Join(",", msgList.ToArray());
                if (msg != "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','" + msg + "仓库已使用,无法删除');", true);
                }
                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList     pkArray = null;
            WHMatBLL      bll     = null;
            List <string> msgList = new List <string>();

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

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

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    CheckBox cbxSelect = this.GvList.Rows[i].Cells[0].FindControl("cbxSelect") as CheckBox;

                    if (cbxSelect.Checked == false)
                    {
                        continue;
                    }


                    //判断是否已使用
                    if (this.GvList.Rows[i].Cells[4].Text != "0")
                    {
                        msgList.Add(this.GvList.Rows[i].Cells[1].Text);
                        continue;
                    }

                    bll.DeleteMatIDCode(new MatIDCode {
                        IDCode = this.GvList.Rows[i].Cells[1].Text
                    });
                }
                string msg = string.Join(",", msgList.ToArray());
                if (msg != "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','" + msg + "条码已使用,无法删除');", true);
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #6
0
        protected void btPrint_Click(object sender, EventArgs e)
        {
            ArrayList     pkArray    = null;
            List <string> idCodeList = new List <string>();

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

                foreach (object key in pkArray)
                {
                    idCodeList.Add(key.ToString());
                }

                Session["idCodeList"] = idCodeList;
                Session["idcodetext"] = "智慧玉洋-" + "货品条码" + "-" + this.MatName.Text;

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "document.getElementById(\"frmPrint\").src = \"IDCodePrint.aspx\";", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #7
0
 protected void GvList_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     GvHelper.DatagridSkinUpdate(e);
 }
Beispiel #8
0
 protected void GvList_PreRender(object sender, EventArgs e)
 {
     GvHelper.DatagridSkin(this.GvList);
 }
Beispiel #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GvHelper obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }