Example #1
0
        protected void btnAddRoles_Click(object sender, EventArgs e)
        {
            wbs = new ActivityManagementService();
            wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationActivity();
            objActivityBo       = new ActivityDetailBO();
            if (hidActivityDetailId.Value.ToInt32() > 0)
            {
                objActivityBo.Mode             = "U";
                objActivityBo.ActivityDetailId = hidActivityDetailId.Value.ToInt32();
            }
            else
            {
                objActivityBo.Mode = "I";
            }

            objActivityBo.ActivityDetailEngName = txtActivityDetailEngName.Text;
            objActivityBo.ActivityDetailNepName = txtActivityDetailNepName.Text;
            objActivityBo.Isenable            = IsActive.Checked == true ? 1 : 0;
            objActivityBo.ActivityUnitId      = ddlUnit.SelectedValue.ToInt32();
            objActivityBo.ActivitySubSectorId = ddlSubSector.SelectedValue.ToInt32();
            wbs.ActivityDetail(objActivityBo);
            Response.Redirect(Constants.ConstantAppPath + "/Modules/ActivityManagement/AddActivityDetail.aspx");
        }
Example #2
0
        protected void BtnEdit_Command(object sender, CommandEventArgs e)
        {
            int roleId = 0;

            if (e.CommandName == "edit")
            {
                roleId = int.Parse(e.CommandArgument.ToString());
                SecureQueryString str = new SecureQueryString();
                str["id"] = e.CommandArgument.ToString();
                Response.Redirect(Constants.ConstantAppPath + "/Modules/ActivityManagement/AddActivityDetail.aspx" + str.EncryptedString, false);
            }
            else if (e.CommandName == "delete")
            {
                int i = 0;
                wbs    = new ActivityManagementService();
                roleId = int.Parse(e.CommandArgument.ToString());
                wbs.AuthSoapHdValue            = ServiceAuth.ServiceAuthenticationActivity();
                objActivityBo                  = new ActivityDetailBO();
                objActivityBo.ActivityDetailId = roleId;
                objActivityBo.Mode             = "D";
                i = wbs.ActivityDetail(objActivityBo);
                //wbs.deleteDonar(donarId);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/ActivityManagement/AddActivityDetail.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Delete failed')</script>");
                }
            }
            else if (e.CommandName == "lock")
            {
                wbs = new ActivityManagementService();
                int i = 0;
                roleId = int.Parse(e.CommandArgument.ToString());
                wbs.AuthSoapHdValue            = ServiceAuth.ServiceAuthenticationActivity();
                objActivityBo                  = new ActivityDetailBO();
                objActivityBo.ActivityDetailId = roleId;
                objActivityBo.Mode             = "L";
                i = wbs.ActivityDetail(objActivityBo);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/ActivityManagement/AddActivityDetail.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Lock failed')</script>");
                }
            }
            else
            {
                wbs = new ActivityManagementService();
                wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationActivity();
                int i = 0;
                roleId        = int.Parse(e.CommandArgument.ToString());
                roleId        = int.Parse(e.CommandArgument.ToString());
                objActivityBo = new ActivityDetailBO();
                objActivityBo.ActivityDetailId = roleId;
                objActivityBo.Mode             = "L";
                i = wbs.ActivityDetail(objActivityBo);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/ActivityManagement/AddActivityDetail.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Delete failed')</script>");
                }
            }
        }