private void LoadAllMunVdc()
        {
            DataTable dtvm = new DataTable();

            wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
            dtvm = wbs.FetchAllVdcMun(Session["LanguageSetting"].ToString());
            Session["vdcList"] = dtvm;
            if (dtvm != null && dtvm.Rows.Count > 0)
            {
                lvVdcMunList.DataSource = dtvm;
                lvVdcMunList.DataBind();
            }
        }
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            VdcMun obj = new VdcMun();

            obj.District      = Convert.ToInt32(ddlDistrict.SelectedValue);
            obj.VdcMunNameEng = txtVMeng.Text;
            obj.VdcMunNameNep = txtVMnep.Text;
            obj.VdcMunType    = ddlVdcMunType.SelectedValue;
            obj.VdcMunCode    = txtVMcode.Text;
            if (chkIsEnable.Checked == true)
            {
                obj.IsEnable = 1;
            }
            else
            {
                obj.IsEnable = 0;
            }
            obj.IsLocked = 0;

            if (VdcMunId == "0")
            {
                objVdcMunService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
                int i = objVdcMunService.InsertVdcMun(obj);
                if (i > 0)
                {
                    Response.Write("<script>alert('VDC/MUN added successfully.');</script>");
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/VdcMunList.aspx");
                }
                else
                {
                    Response.Write("<script>alert('VDC/MUN addition failed!');</script>");
                }
            }
            else
            {
                obj.VdcMunId = VdcMunId;
                objVdcMunService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
                int i = objVdcMunService.UpdateVdcMunById(obj);
                if (i > 0)
                {
                    Response.Write("<script>alert('VDC/MUN updated successfully');</script>");
                    Response.RedirectPermanent(Constants.ConstantAppPath + "/Modules/DirectoryManagement/VdcMunList.aspx");
                }
                else
                {
                    Response.Write("<script>alert('VDC/MUN update failed');</script>");
                }
            }
        }
Ejemplo n.º 3
0
        public void PopulateVdcMunByDisId(int disId)
        {
            DataTable dt = null;

            objVdcMunService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
            dt = objVdcMunService.populateVdcMun(ddlDistrict.SelectedValue.ToInt32());
            if (dt != null && dt.Rows.Count > 0)
            {
                ddlVdcMun.DataSource     = dt;
                ddlVdcMun.DataValueField = "VDC_ID";
                ddlVdcMun.DataTextField  = "VDC_NEP_NAME";
                ddlVdcMun.DataBind();
                ddlVdcMun.Items.Insert(0, "--गाविस/न.पा. छान्नुहोस्--");
            }
        }
 protected void BtnEdit_Command(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "edit")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         SecureQueryString str = new SecureQueryString();
         str["id"] = e.CommandArgument.ToString();
         Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/AddMunVdc.aspx" + str.EncryptedString);
     }
     else if (e.CommandName == "delete")
     {
         int id = 0;
         id = Convert.ToInt32(e.CommandArgument.ToString());
         wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
         int a = wbs.DeleteVdcMunById(id);
         if (a > 0)
         {
             Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/VdcMunList.aspx");
         }
         else
         {
             Response.Write("<script>alert('VDC/MUN delete failed!')</script>");
         }
     }
     else if (e.CommandName == "lock")
     {
         int id = 0;
         id = int.Parse(e.CommandArgument.ToString());
         wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
         wbs.LockVdcMun(id);
         Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/VdcMunList.aspx");
     }
     else
     {
         int id = 0;
         id = int.Parse(e.CommandArgument.ToString());
         wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
         wbs.UnlockVdcMun(id);
         Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/VdcMunList.aspx");
     }
 }
        private void loadMunVdcDetails(string id)
        {
            objVdcMunService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationVdcMun();
            DataTable dtud = objVdcMunService.FetchMunVdcDetailsById(id);

            if (dtud != null && dtud.Rows.Count > 0)
            {
                txtVMeng.Text  = dtud.Rows[0]["VDC_ENG_NAME"].ToString();
                txtVMnep.Text  = dtud.Rows[0]["VDC_NEP_NAME"].ToString();
                txtVMcode.Text = dtud.Rows[0]["VDC_CODE"].ToString();
                ddlVdcMunType.SelectedValue = dtud.Rows[0]["VDCMUN_TYPE"].ToString();
                ddlDistrict.SelectedValue   = dtud.Rows[0]["DISTRICT_ID"].ToString();
                if (dtud.Rows[0]["ISENABLE"].ToString() == "1")
                {
                    chkIsEnable.Checked = true;
                }
                else
                {
                    chkIsEnable.Checked = false;
                }
            }
        }