protected void btnFilter_Click(object sender, EventArgs e)
        {
            lvProject.DataSource = null;
            lvProject.DataBind();
            DataTable dtProjects = null;

            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            if (Session["office_type_id"].ToInt32() == 4 || Session["office_type_id"].ToInt32() == 5 ||
                Session["office_type_id"].ToInt32() == 6)
            {
                dtProjects = objService1.PopulatePPByUserId(Session["LanguageSetting"].ToString(),
                                                            Session["user_id"].ToInt32(), ddlTrimester.SelectedValue.ToInt32(), Session["fiscal_year_id"].ToInt32());
            }
            //for npc users and others;
            else
            {
                dtProjects = objService1.PopulatePPByMinistryId(Session["LanguageSetting"].ToString(),
                                                                ddlMinistry.SelectedValue.ToInt32(), ddlTrimester.SelectedValue.ToInt32(), Session["fiscal_year_id"].ToInt32());
            }

            if (dtProjects != null && dtProjects.Rows.Count > 0)
            {
                lvProject.DataSource = dtProjects;
                lvProject.DataBind();
            }
        }
        protected void btnAddBudgetHead_Click(object sender, EventArgs e)
        {
            int i = 0;

            objBudgetBo = new ComBudgetHeadBO();
            objBudgetBo.BudgetHeadEngName = txtBudgetHeadEnglishName.Text;
            objBudgetBo.BudgetHeadNepName = txtBudgetHeadNepaliName.Text;
            objBudgetBo.BudgetCode        = txtBudgetCode.Text;
            objBudgetBo.FiscalYearId      = ddlFiscalYear.SelectedValue.ToInt32();
            objBudgetBo.BudgetHeadId      = Session["budgetHeadId"].ToInt32();
            objBudgetBo.IsLocked          = 0;
            if (chkIsEnable.Checked == true)
            {
                objBudgetBo.IsEnable = 1;
            }
            else
            {
                objBudgetBo.IsEnable = 0;
            }
            objWebService = new Service1();
            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();

            i = objWebService.AddEditBudgetHead(objBudgetBo);
            if (i > 0)
            {
                Response.Write("<script>alert('Budget Head added successfully!')</script>");
                Response.Redirect(Constants.ConstantAppPath + "/Modules/Budget/BudgHeadList1.aspx");
            }
            else
            {
                Response.Write("<script>alert('Budget Head addition failed!')</script>");
            }
        }
 private void PopulateBudgetHead()
 {
     objService1 = new Service1();
     objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
     // for project/program admin and data entry
     if (Session["role_id"].ToInt32() == 4 || Session["role_id"].ToInt32() == 6)
     {
         /*dtPopulateBudgetHead =
          *  objService1.PopulateAllBudgetHeadsByOfficeId(Session["LanguageSetting"].ToString(),
          *      Session["office_id"].ToInt32());*/
         dtPopulateBudgetHead =
             objService1.PopulateAllBudgetHeadsByUserId(Session["LanguageSetting"].ToString(),
                                                        Session["user_id"].ToInt32());
     }
     //for npc users and others;
     else
     {
         int ministryId = ddlMinistry.SelectedValue.ToInt32();
         dtPopulateBudgetHead =
             objService1.PopulateAllBudgetHeads(Session["LanguageSetting"].ToString(),
                                                ministryId);
     }
     if (dtPopulateBudgetHead != null && dtPopulateBudgetHead.Rows.Count > 0)
     {
         ddlBudgetHead.DataSource     = dtPopulateBudgetHead;
         ddlBudgetHead.DataTextField  = "BUDGET_HEAD_NAME";
         ddlBudgetHead.DataValueField = "BUDGET_HEAD_ID";
         ddlBudgetHead.DataBind();
         ddlBudgetHead.Items.Insert(0, "--छान्नुहोस्--");
     }
 }
        private void PopulateBudgetHead()
        {
            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            // for project/program/pariyojana users
            if (Session["office_type_id"].ToInt32() == 4 || Session["office_type_id"].ToInt32() == 5 ||
                Session["office_type_id"].ToInt32() == 6)
            {
                Session["dtPopulateBudgetHead"] =
                    objService1.PopulateAllBudgetHeadsByUserId(Session["LanguageSetting"].ToString(),
                                                               Session["user_id"].ToInt32());
            }
            //for npc users and others;
            else
            {
                Session["dtPopulateBudgetHead"] =
                    objService1.PopulateAllBudgetHeads(Session["LanguageSetting"].ToString(),
                                                       ddlMinistry.SelectedValue.ToInt32());
            }

            DataTable dtPopulateBudgetHead = (DataTable)Session["dtPopulateBudgetHead"];

            if (dtPopulateBudgetHead != null && dtPopulateBudgetHead.Rows.Count > 0)
            {
                ddlBudghead.DataSource     = dtPopulateBudgetHead;
                ddlBudghead.DataTextField  = "BUDGET_HEAD_NAME";
                ddlBudghead.DataValueField = "BUDGET_HEAD_ID";
                ddlBudghead.DataBind();
                ddlBudghead.Items.Insert(0, "--छान्नुहोस्--");
            }
        }
示例#5
0
        protected void BtnEdit_Command(object sender, CommandEventArgs e)
        {
            int ministryId = 0;

            if (e.CommandName == "edit")
            {
                ministryId = int.Parse(e.CommandArgument.ToString());
                SecureQueryString str = new SecureQueryString();
                str["ministryId"] = e.CommandArgument.ToString();
                Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/AddMinistry.aspx" + str.EncryptedString, false);
            }
            else if (e.CommandName == "delete")
            {
                ministryId = int.Parse(e.CommandArgument.ToString());
                objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
                objWebService.deleteMinistry(ministryId);
                Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/MinistryList.aspx");
            }
            else if (e.CommandName == "lock")
            {
                ministryId = int.Parse(e.CommandArgument.ToString());
                objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
                // objWebService.lockMinistry(ministryId);
                Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/MinistryList.aspx");
            }
            else
            {
                ministryId = int.Parse(e.CommandArgument.ToString());
                objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
                // objWebService.lockMinistry(ministryId);
                Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/MinistryList.aspx");
            }
        }
示例#6
0
 private void BindListView()
 {
     objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
     dtListView = objWebService.PopulateAllMinistries(Session["LanguageSetting"].ToString());
     if (dtListView != null && dtListView.Rows.Count > 0)
     {
         lvMinistry.DataSource = dtListView;
         lvMinistry.DataBind();
     }
 }
示例#7
0
 private void populateMinistryDetails(int ministryId)
 {
     objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
     dtPopulateMinistryDetails     = objWebService.PopulateMinistryDetails(ministryId);
     if (dtPopulateMinistryDetails != null && dtPopulateMinistryDetails.Rows.Count > 0)
     {
         txtMinistryEnglishName.Text = dtPopulateMinistryDetails.Rows[0]["MINISTRY_ENG_NAME"].ToString();
         txtMinistryNepaliName.Text  = dtPopulateMinistryDetails.Rows[0]["MINISTRY_NEP_NAME"].ToString();
         txtCode.Text = dtPopulateMinistryDetails.Rows[0]["MINISTRY_CODE"].ToString();
     }
 }
        protected void btnMap_Click(object sender, EventArgs e)
        {
            // Clear Budget User Map
            int j = 0;

            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            //j=objService1.ClearBudgetOrganizationMap(ddlBudgetHead.SelectedValue.ToInt32());
            if (ddlBudgetHead.SelectedValue.ToInt32() > 0)
            {
                if (ddlMinistry.SelectedValue.ToInt32() > 0)
                {
                    if (ddlOffice.SelectedValue.ToInt32() > 0)
                    {
                        j = objService1.ClearBudgetUserMap(ddlOffice.SelectedValue.ToInt32(), ddlBudgetHead.SelectedValue.ToInt32(), ddlMinistry.SelectedValue.ToInt32());
                        int i = 0;
                        foreach (ListItem it in chkUsers.Items)
                        {
                            if (it.Selected)
                            {
                                objService1 = new Service1();
                                objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();

                                /* i = objService1.InsertBudgetOrganizationMap(ddlBudgetHead.SelectedValue.ToInt32(),
                                 *                                              it.Value.ToInt32());*/
                                i = objService1.InsertBudgetUserMap(ddlBudgetHead.SelectedValue.ToInt32(),
                                                                    ddlMinistry.SelectedValue.ToInt32(), ddlOffice.SelectedValue.ToInt32(),
                                                                    it.Value.ToInt32());
                            }
                        }
                        if (i > 0)
                        {
                            Response.Write("<script>alert('Mapping Successful')</script>");
                            Response.Redirect(Constants.ConstantAppPath + "/Modules/Budget/BudgetToOrganizationMap.aspx");
                        }
                    }
                    else
                    {
                        Response.Write("<script>alert('Please select office')</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('Please select ministry')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('Please budget head')</script>");
            }
        }
 private void PopulateBudgetHead()
 {
     objService1 = new Service1();
     objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
     dtPopulateBudgetHead        = objService1.PopulateAllBudgetHeads(Session["LanguageSetting"].ToString());
     if (dtPopulateBudgetHead != null && dtPopulateBudgetHead.Rows.Count > 0)
     {
         ddlBudgetHead.DataSource     = dtPopulateBudgetHead;
         ddlBudgetHead.DataTextField  = "BUDGET_HEAD_NAME";
         ddlBudgetHead.DataValueField = "BUDGET_HEAD_ID";
         ddlBudgetHead.DataBind();
         ddlBudgetHead.Items.Insert(0, "--Choose Budget Head--");
     }
 }
        protected void BtnEdit_Command(object sender, CommandEventArgs e)
        {
            int budgetHeadId = 0;

            if (e.CommandName == "edit")
            {
                budgetHeadId = int.Parse(e.CommandArgument.ToString());
                SecureQueryString str = new SecureQueryString();
                str["budgetHeadId"] = e.CommandArgument.ToString();
                Response.Redirect(Constants.ConstantAppPath + "/Modules/Budget/AddBudgetHead.aspx" + str.EncryptedString, false);
            }
            else if (e.CommandName == "delete")
            {
                budgetHeadId = int.Parse(e.CommandArgument.ToString());
                objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
                objWebService.deleteBudgetHead(budgetHeadId);
                Response.Redirect(Constants.ConstantAppPath + "/Modules/Budget/BudgHeadList1.aspx");
            }
            else if (e.CommandName == "lock")
            {
                int i = 0;
                budgetHeadId = int.Parse(e.CommandArgument.ToString());
                objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
                i = objWebService.LockBudgetHead(budgetHeadId);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/Budget/BudgHeadList1.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Lock failed')</script>");
                }
            }
            else
            {
                int i = 0;
                budgetHeadId = int.Parse(e.CommandArgument.ToString());
                objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
                i = objWebService.UnlockBudgetHead(budgetHeadId);
                if (i > 0)
                {
                    Response.Redirect(Constants.ConstantAppPath + "/Modules/Budget/BudgHeadList1.aspx");
                }
                else
                {
                    Response.Write("<script>alert('Unlock failed')</script>");
                }
            }
        }
示例#11
0
        private void populateDistrict()
        {
            DataTable dt = null;

            objService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            dt = objService.populateDistrict(Session["LanguageSetting"].ToString());
            if (dt != null && dt.Rows.Count > 0)
            {
                ddlDistrict.DataSource     = dt;
                ddlDistrict.DataValueField = "DISTRICT_ID";
                ddlDistrict.DataTextField  = "DISTRICT_NAME";
                ddlDistrict.DataBind();
                ddlDistrict.Items.Insert(0, "--जिल्ला छान्नुहोस्--");
            }
        }
        private void LoadRole()
        {
            DataTable dtr = new DataTable();

            wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            dtr = wbs.FetchAllRole();
            if (dtr != null && dtr.Rows.Count > 0)
            {
                ddlRole.DataSource     = dtr;
                ddlRole.DataTextField  = "ROLE_NEP_NAME";
                ddlRole.DataValueField = "ROLE_ID";
                ddlRole.DataBind();
                ddlRole.Items.Insert(0, "CHOOSE ROLE");
            }
        }
        private void LoadDistrict()
        {
            DataTable dtd = new DataTable();

            wbs.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            dtd = wbs.FetchDistrict(Session["LanguageSetting"].ToString());
            if (dtd != null && dtd.Rows.Count > 0)
            {
                ddlDistrict.DataSource     = dtd;
                ddlDistrict.DataTextField  = "DISTRICT_NAME";
                ddlDistrict.DataValueField = "DISTRICT_ID";
                ddlDistrict.DataBind();
                ddlDistrict.Items.Insert(0, "Choose District");
            }
        }
 private void BindListView()
 {
     objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
     dtListView = objWebService.PopulateAllBudgetHeads(Session["LanguageSetting"].ToString(), Session["ministry_id"].ToInt32());
     if (dtListView != null && dtListView.Rows.Count > 0)
     {
         //lblBudgetHead.Visible = true;
         ListView1.DataSource = dtListView;
         ListView1.DataBind();
     }
     else
     {
         //lblBudgetHead.Visible = true;
     }
 }
        private void populateFiscalYear()
        {
            DataTable DtFiscalYear = null;

            objWebService = new Service1();
            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            DtFiscalYear = objWebService.PopulateFiscalYear();
            if (DtFiscalYear != null && DtFiscalYear.Rows.Count > 0)
            {
                ddlFiscalYear.DataSource     = DtFiscalYear;
                ddlFiscalYear.DataTextField  = "FISCAL_YEAR_NEP";
                ddlFiscalYear.DataValueField = "FISCAL_YEAR_ID";
                ddlFiscalYear.DataBind();
                ddlFiscalYear.Items.Insert(0, "--आ.व. छान्नुहोस्--");
            }
        }
        private void PopulateBudgetHead()
        {
            objService1 = new Service1();
            objService1.AuthSoapHdValue     = ServiceAuth.ServiceAuthentication();
            Session["dtPopulateBudgetHead"] = objService1.PopulateAllBudgetHeads(Session["LanguageSetting"].ToString(), Session["ministry_id"].ToInt32());
            DataTable dtPopulateBudgetHead = (DataTable)Session["dtPopulateBudgetHead"];

            if (dtPopulateBudgetHead != null && dtPopulateBudgetHead.Rows.Count > 0)
            {
                ddlBudgetHead.DataSource     = dtPopulateBudgetHead;
                ddlBudgetHead.DataTextField  = "BUDGET_HEAD_NAME";
                ddlBudgetHead.DataValueField = "BUDGET_HEAD_ID";
                ddlBudgetHead.DataBind();
                ddlBudgetHead.Items.Insert(0, "--छान्नुहोस्--");
            }
        }
        protected void btnFilter_Click(object sender, EventArgs e)
        {
            lvProject.DataSource = null;
            lvProject.DataBind();
            DataTable dtProjects = null;

            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();

            dtProjects = objService1.PopulatePSByMinistryId(ddlMinistry.SelectedValue.ToInt32(),
                                                            ddlTrimester.SelectedValue.ToInt32(), Session["fiscal_year_id"].ToInt32());

            if (dtProjects != null && dtProjects.Rows.Count > 0)
            {
                lvProject.DataSource = dtProjects;
                lvProject.DataBind();
            }
        }
示例#18
0
        protected void btnAddMinistry_Click(object sender, EventArgs e)
        {
            int i = 0;

            objComMinistry.ministryEnglishName = txtMinistryEnglishName.Text;
            objComMinistry.ministryNepaliName  = txtMinistryNepaliName.Text;
            objComMinistry.ministryCode        = txtCode.Text;
            objWebService.AuthSoapHdValue      = ServiceAuth.ServiceAuthentication();
            i = objWebService.AddMinistry(objComMinistry, ministryId);
            if (i > 0)
            {
                Response.Write("<script>alert('Ministry added successfully!')</script>");
                Response.Redirect(Constants.ConstantAppPath + "/Modules/DirectoryManagement/MinistryList.aspx");
            }
            else
            {
                Response.Write("<script>alert('Ministry addition failed!')</script>");
            }
        }
        private void PopulateBudgetUserMap(int budgetHeadId)
        {
            DataTable dtUsers = (DataTable)Session["dtUsers"];

            chkUsers.DataSource = dtUsers;
            if (Session["LanguageSetting"].ToString() == "Nepali")
            {
                chkUsers.DataTextField = "USER_NEP_NAME";
            }
            else
            {
                chkUsers.DataTextField = "USER_ENG_NAME";
            }
            chkUsers.DataValueField = "USER_ID";
            chkUsers.DataBind();
            DataTable dt = null;

            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            /*dt = objService1.PopulateBudgetOrganizationMap(budgetHeadId);*/
            dt = objService1.PopulateBudgetUserMap(budgetHeadId);
            if (dt != null && dt.Rows.Count > 0)
            {
                List <string> users = new List <string>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    users.Add(dt.Rows[i]["USER_ID"].ToString());
                }

                for (int k = 0; k < chkUsers.Items.Count; k++)
                {
                    for (int j = 0; j < users.Count; j++)
                    {
                        if (chkUsers.Items[k].Value == users[j])
                        {
                            chkUsers.Items[k].Selected = true;
                            break;
                        }
                    }
                }
            }
        }
示例#20
0
        private void populateResponsibleBody()
        {
            /*DataTable dt = new DataTable();
             * objOutputTarget = new OutputTarget();
             * objOutputTarget.Lang = Session["LanguageSetting"].ToString();
             * objWebService = new OutputTargetService();
             * objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget();
             * dt = objWebService.PopulateOffice(objOutputTarget);
             *
             * if (dt != null && dt.Rows.Count > 0)
             * {
             *  chkResponsibleOffices.DataSource = dt;
             *  chkResponsibleOffices.DataTextField = "OFFICE_NAME";
             *  chkResponsibleOffices.DataValueField = "OFFICE_ID";
             *  chkResponsibleOffices.DataBind();
             * }*/
            DataTable dt = new DataTable();

            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            dt = objService1.PopulateMinistries();

            if (dt != null && dt.Rows.Count > 0)
            {
                chkResponsibleOffices.DataSource = dt;
                if (Session["LanguageSetting"].ToString() == "Nepali")
                {
                    chkResponsibleOffices.DataTextField = "OFFICE_NEP_NAME";
                }
                else
                {
                    chkResponsibleOffices.DataTextField = "OFFICE_ENG_NAME";
                }

                chkResponsibleOffices.DataValueField = "OFFICE_ID";
                chkResponsibleOffices.DataBind();
            }
        }
        private void populateBudgetHeadDetails(int i)
        {
            objWebService = new Service1();
            objWebService.AuthSoapHdValue          = ServiceAuth.ServiceAuthentication();
            Session["dtPopulateBudgetHeadDetails"] = objWebService.PopulateBudgetHeadDetails(i);
            DataTable dtPopulateBudgetHeadDetails = (DataTable)Session["dtPopulateBudgetHeadDetails"];

            if (dtPopulateBudgetHeadDetails != null && dtPopulateBudgetHeadDetails.Rows.Count > 0)
            {
                txtBudgetHeadEnglishName.Text = dtPopulateBudgetHeadDetails.Rows[0]["budget_head_eng_name"].ToString();
                txtBudgetHeadNepaliName.Text  = dtPopulateBudgetHeadDetails.Rows[0]["budget_head_nep_name"].ToString();
                txtBudgetCode.Text            = dtPopulateBudgetHeadDetails.Rows[0]["budget_code"].ToString();
                ddlFiscalYear.SelectedValue   = dtPopulateBudgetHeadDetails.Rows[0]["fiscal_year_id"].ToString();
                if (Convert.ToInt16(dtPopulateBudgetHeadDetails.Rows[0]["ISENABLE"]) == 1)
                {
                    chkIsEnable.Checked = true;
                }
                else
                {
                    chkIsEnable.Checked = false;
                }
            }
        }
        private void PopulateUsersByOfficeId(int officeId)
        {
            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            Session["dtUsers"]          = objService1.PopulateAllUsersByOfficeId(officeId);
            DataTable dtUsers = (DataTable)Session["dtUsers"];

            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                chkUsers.DataSource = dtUsers;
                if (Session["LanguageSetting"].ToString() == "Nepali")
                {
                    chkUsers.DataTextField = "USER_NEP_NAME";
                }
                else
                {
                    chkUsers.DataTextField = "USER_ENG_NAME";
                }

                chkUsers.DataValueField = "USER_ID";
                chkUsers.DataBind();
            }
        }
        private void PopulateOffices(int ministryId)
        {
            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            Session["dtOffices"]        = objService1.PopulateAllOffices(ministryId);
            DataTable dtOffices = (DataTable)Session["dtOffices"];

            if (dtOffices != null && dtOffices.Rows.Count > 0)
            {
                ddlOffice.DataSource = dtOffices;
                if (Session["LanguageSetting"].ToString() == "Nepali")
                {
                    ddlOffice.DataTextField = "OFFICE_NEP_NAME";
                }
                else
                {
                    ddlOffice.DataTextField = "OFFICE_ENG_NAME";
                }

                ddlOffice.DataValueField = "OFFICE_ID";
                ddlOffice.DataBind();
            }
        }
        private void PopulateMinistries()
        {
            objService1 = new Service1();
            objService1.AuthSoapHdValue = ServiceAuth.ServiceAuthentication();
            Session["dtMinistries"]     = objService1.PopulateMinistries();
            DataTable dtMinistries = (DataTable)Session["dtMinistries"];

            if (dtMinistries != null && dtMinistries.Rows.Count > 0)
            {
                ddlMinistry.DataSource = dtMinistries;
                if (Session["LanguageSetting"].ToString() == "Nepali")
                {
                    ddlMinistry.DataTextField = "OFFICE_NEP_NAME";
                }
                else
                {
                    ddlMinistry.DataTextField = "OFFICE_ENG_NAME";
                }

                ddlMinistry.DataValueField = "OFFICE_ID";
                ddlMinistry.DataBind();
                ddlMinistry.Items.Insert(0, "--छान्नुहोस्--");
            }
        }