Ejemplo n.º 1
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string strDeptName     = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[0].Controls[1]).Text;
            string strAddress      = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[1].Controls[1]).Text;
            string strTel          = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[2].Controls[1]).Text;
            string strManager      = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[3].Controls[1]).Text;
            string strManagerPhone = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[4].Controls[1]).Text;
            string strAdsl         = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[5].Controls[1]).Text;
            string strAdslPwd      = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[6].Controls[1]).Text;
            string strVpn          = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[7].Controls[1]).Text;
            string strVpnPwd       = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[8].Controls[1]).Text;
            string strOldDeptName  = ((Label)this.GridView1.Rows[e.RowIndex].Cells[9].Controls[1]).Text;

            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.ExistDeptInfo(strDeptName);
                if (strDeptName != strOldDeptName && exist)
                {
                    this.Popup("门店已存在");
                    return;
                }
                bool success = busiq.UpdateDeptInfo(strOldDeptName, strDeptName, strAddress, strTel, strManager, strManagerPhone, strAdsl, strAdslPwd, strVpn, strVpnPwd);
                if (!success)
                {
                    this.SetErrorMsgPageBydir("门店信息修改出错,请重试!");
                    return;
                }
                else
                {
                    this.GridView1.EditIndex = -1;
                    this.Query();
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("门店信息修改错误,请重试!");
                return;
            }
        }