コード例 #1
0
        private void DataGrid1_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
                Hashtable htpara           = new Hashtable();
                htpara.Add("strOutCount", e.Item.Cells[10].Text.Trim());
                htpara.Add("strSerialOld", e.Item.Cells[0].Text.Trim());
                htpara.Add("strOperDate", DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
                htpara.Add("strOperName", ls1.strOperName);
                htpara.Add("strDeptID", ls1.strNewDeptID);
                htpara.Add("strMaterialCode", e.Item.Cells[2].Text.Trim());
                htpara.Add("strBatchNo", e.Item.Cells[1].Text.Trim());

                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                msb1 = new MaterialSBusi(strcons);

                if (msb1.MaterialOutModDetele(htpara))
                {
                    this.Popup("原材料出库修正删除成功!");
                    this.DBbind();
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("原材料出库修正删除失败!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }