Ejemplo n.º 1
0
 private void PopulateFrameworkDetails(int frameworkId)
 {
     objFrameworkBO             = new FrameworkBO();
     objFrameworkBO.FrameworkId = frameworkId;
     objFramework = new FrameworkManagementService();
     objFramework.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationFramework();
     dtFramework = objFramework.PopulateFrameworkDetails(objFrameworkBO);
     if (dtFramework != null && dtFramework.Rows.Count > 0)
     {
         ddlBaseYear.SelectedValue   = dtFramework.Rows[0]["BASE_YEAR_ID"].ToString();
         ddlFirstYear.SelectedValue  = dtFramework.Rows[0]["FIRST_YEAR_ID"].ToString();
         ddlSecondYear.SelectedValue = dtFramework.Rows[0]["SECOND_YEAR_ID"].ToString();
         ddlThirdYear.SelectedValue  = dtFramework.Rows[0]["THIRD_YEAR_ID"].ToString();
     }
 }
        private void PopulateAllFrameworks()
        {
            lvFramework.DataSource = null;
            lvFramework.DataBind();

            objFrameworkBo      = new FrameworkBO();
            wbs                 = new FrameworkManagementService();
            wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationFramework();
            dtFrameworks        = wbs.PopulateAllFrameworks();
            if (dtFrameworks != null && dtFrameworks.Rows.Count > 0)
            {
                lvFramework.DataSource = dtFrameworks;
                lvFramework.DataBind();
            }
        }
Ejemplo n.º 3
0
        protected void btnAddFramework_Click(object sender, EventArgs e)
        {
            objFramework                    = new FrameworkManagementService();
            objFrameworkBO                  = new FrameworkBO();
            objFrameworkBO.FrameworkId      = Session["frameworkId"].ToInt32();
            objFrameworkBO.FrameworkEngName = txtFrameworkEngName.Text;
            objFrameworkBO.FrameworkNepName = txtFrameworkNepName.Text;
            objFrameworkBO.BaseYearId       = ddlBaseYear.SelectedValue.ToInt32();
            objFrameworkBO.FirstYearId      = ddlFirstYear.SelectedValue.ToInt32();
            objFrameworkBO.SecondYearId     = ddlSecondYear.SelectedValue.ToInt32();
            objFrameworkBO.ThirdYearId      = ddlThirdYear.SelectedValue.ToInt32();
            if (Session["frameworkId"].ToInt32() > 0)
            {
                objFrameworkBO.Mode = "U";
            }
            else
            {
                objFrameworkBO.Mode = "I";
            }

            objFrameworkBO.IsEnable      = 1;
            objFrameworkBO.IsLocked      = 0;
            objFramework.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationFramework();
            Int32 i = 0;

            i = objFramework.AddEditFramework(objFrameworkBO);
            if (i > 0)
            {
                Response.Write("<script>alert('Framework added successfully!')</script>");
                Response.Redirect(Constants.ConstantAppPath + "/Modules/FrameworkManagement/AddEditFramework.aspx");
            }
            else
            {
                Response.Write("<script>alert('Framework addition failed!')</script>");
            }
        }
        protected void BtnEdit_Command(object sender, CommandEventArgs e)
        {
            int frameworkId = 0;

            if (e.CommandName == "edit")
            {
                frameworkId = int.Parse(e.CommandArgument.ToString());
                SecureQueryString str = new SecureQueryString();
                str["frameworkId"] = e.CommandArgument.ToString();
                Response.Redirect(Constants.ConstantAppPath + "/Modules/FrameworkManagement/AddEditFramework.aspx" + str.EncryptedString);
            }
            else if (e.CommandName == "delete")
            {
                int i = 0;
                frameworkId                = int.Parse(e.CommandArgument.ToString());
                objFrameworkBo             = new FrameworkBO();
                objFrameworkBo.FrameworkId = frameworkId;
                objFrameworkBo.Mode        = "D";
                wbs = new FrameworkManagementService();
                wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationFramework();
                i = wbs.AddEditFramework(objFrameworkBo);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/FrameworkManagement/FrameworkList.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Delete failed')</script>");
                }
            }
            else if (e.CommandName == "lock")
            {
                int i = 0;
                frameworkId                = int.Parse(e.CommandArgument.ToString());
                objFrameworkBo             = new FrameworkBO();
                objFrameworkBo.FrameworkId = frameworkId;
                objFrameworkBo.Mode        = "L";
                wbs = new FrameworkManagementService();
                wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationFramework();
                i = wbs.AddEditFramework(objFrameworkBo);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/FrameworkManagement/FrameworkList.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Lock failed')</script>");
                }
            }
            else
            {
                int i = 0;
                frameworkId                = int.Parse(e.CommandArgument.ToString());
                objFrameworkBo             = new FrameworkBO();
                objFrameworkBo.FrameworkId = frameworkId;
                objFrameworkBo.Mode        = "L";
                wbs = new FrameworkManagementService();
                wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationFramework();
                i = wbs.AddEditFramework(objFrameworkBo);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/FrameworkManagement/FrameworkList.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Unlock failed')</script>");
                }
            }
        }