Пример #1
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList      pkArray = null;
            WorkStationBLL bll     = null;

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

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

                foreach (object key in pkArray)
                {
                    if (!bll.HasUsed(key.ToString()))
                    {
                        bll.DeleteWorkStation(new WorkStation {
                            PID = key.ToString()
                        });
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('选中的工位被使用过,不能被删除');", true);
                    }
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }