Ejemplo n.º 1
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string strSerial = this.GridView1.Rows[e.RowIndex].Cells[0].Text;
            string strDeptId = this.GridView1.Rows[e.RowIndex].Cells[11].Text;
            string strFlag   = this.GridView1.Rows[e.RowIndex].Cells[8].Text;

            if (strFlag != "正常消费")
            {
                this.Popup("撤销已审核");
                return;
            }
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            busiq = new BusiComm.BusiQuery(strcons);
            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
            try
            {
                bool exist = busiq.ExistConsItemUndo(strSerial, strDeptId);
                if (exist)
                {
                    this.Popup("已撤销");
                    return;
                }
                bool success = busiq.InsertConsItemUndo(strSerial, ls1.strOperName, strDeptId);
                if (!success)
                {
                    this.SetErrorMsgPageBydir("零售撤销出错,请重试!");
                    return;
                }
                else
                {
                    this.GridView1.EditIndex = -1;
                    this.btQuery_Click(null, null);
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("零售撤销错误,请重试!");
                return;
            }
        }