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;
                ddlMinistryPriority.DataSource = dtMinistries;
                if (Session["LanguageSetting"].ToString() == "Nepali")
                {
                    ddlMinistry.DataTextField         = "OFFICE_NEP_NAME";
                    ddlMinistryPriority.DataTextField = "OFFICE_NEP_NAME";
                }
                else
                {
                    ddlMinistry.DataTextField         = "OFFICE_ENG_NAME";
                    ddlMinistryPriority.DataTextField = "OFFICE_ENG_NAME";
                }

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

                ddlMinistryPriority.DataValueField = "OFFICE_ID";
                ddlMinistryPriority.DataBind();
                ddlMinistryPriority.Items.Insert(0, "--छान्नुहोस्--");
            }
        }
Example #2
0
        public List <Combo> FindProjectByMinistryId(int ministryId)
        {
            ProjectService objWebService     = new ProjectService();
            ComProjectBO   objComProjectBO   = new ComProjectBO();
            DataTable      dtPopulateProject = new DataTable();
            List <Combo>   objList           = new List <Combo>();

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.Lang          = Session["LanguageSetting"].ToString();
            objComProjectBO.MinistryId    = ministryId;
            dtPopulateProject             = objWebService.PopulateProjectByMinstryId(objComProjectBO);

            if (dtPopulateProject != null && dtPopulateProject.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtPopulateProject.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["PROJECT_ID"].ToInt32(), Name = dr["PROJECT_NAME"].ToString()
                    });
                }
            }
            return(objList);
        }
        protected void btnChangePassword_Click(object sender, EventArgs e)
        {
            objComLogin = new ComLogin();
            int i = 0;

            if (txtOldPassword.Text == Session["password"].ToString())
            {
                if (txtNewPassword.Text == txtConfirmNewPassword.Text)
                {
                    objComLogin.NewPassword       = txtNewPassword.Text;
                    objComLogin.UserId            = Session["user_id"].ToInt32();
                    objWebService                 = new LoginService();
                    objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationLogin();
                    i = objWebService.ChangePassword(objComLogin);
                    if (i > 0)
                    {
                        Session["password"] = txtNewPassword.Text;
                        Response.Write("<script>alert('पासवर्ड परिवर्तन सफल भएको छ।')</script>");
                        Response.Redirect(Constants.ConstantAppPath + "/Home.aspx");
                    }
                }
                else
                {
                    Response.Write(
                        "<script>alert('नयाँ पासवर्ड मिलेन।')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('पुरानो पासवर्ड मिलेन।')</script>");
            }
        }
Example #4
0
        public List <Combo> FindKaryanitiByRananitiId(string rananitiId)
        {
            ProjectService objWebService       = new ProjectService();
            ComProjectBO   objComProjectBO     = new ComProjectBO();
            DataTable      dtPopulateKaryaniti = new DataTable();
            List <Combo>   objList             = new List <Combo>();

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.Rananiti      = rananitiId.ToInt32();
            objComProjectBO.Lang          = Session["LanguageSetting"].ToString();
            dtPopulateKaryaniti           = objWebService.PopulateKaryanitiByRananitiId(objComProjectBO);
            if (dtPopulateKaryaniti != null && dtPopulateKaryaniti.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtPopulateKaryaniti.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["KARYANITI_ID"].ToInt32(), Name = dr["KARYANITI_NAME"].ToString()
                    });
                }
            }
            return(objList);
        }
Example #5
0
        public List <Combo> FindRananitiBySectorId(string subSectorId)
        {
            ProjectService  objWebService      = new ProjectService();
            EntitySubSector objComSubSector    = new EntitySubSector();
            DataTable       dtPopulateRananiti = null;
            List <Combo>    objList            = new List <Combo>();

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            objComSubSector.SubSectorId   = subSectorId.ToDecimal();
            objComSubSector.Lang          = Session["LanguageSetting"].ToString();
            dtPopulateRananiti            = objWebService.PopulateRananitiBySubSectorId(objComSubSector);
            if (dtPopulateRananiti != null && dtPopulateRananiti.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtPopulateRananiti.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["RANANITI_ID"].ToInt32(), Name = dr["RANANITI_NAME"].ToString()
                    });
                }
            }
            return(objList);
        }
Example #6
0
        public List <Combo> FindSahasabdiBikashGantabyaByLakshya(string lakshyaId)
        {
            ProjectService objWebService      = new ProjectService();
            ComProjectBO   objComProjectBO    = new ComProjectBO();
            DataTable      dtPopulateGantabya = new DataTable();
            List <Combo>   objList            = new List <Combo>();

            objWebService.AuthSoapHdValue          = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.SahasabdiBikashLakshya = lakshyaId.ToInt32();
            objComProjectBO.Lang = Session["LanguageSetting"].ToString();
            dtPopulateGantabya   = objWebService.PopulateSahashrabdiBikashGantabya(objComProjectBO);
            if (dtPopulateGantabya != null && dtPopulateGantabya.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtPopulateGantabya.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["GANTABYA_ID"].ToInt32(), Name = dr["GANTABYA_NAME"].ToString()
                    });
                }
            }
            return(objList);
        }
Example #7
0
        public List <Combo> FindDigoBikashSuchakByGantabya(string gantabyaId)
        {
            ProjectService objWebService    = new ProjectService();
            ComProjectBO   objComProjectBO  = new ComProjectBO();
            DataTable      dtPopulateSuchak = new DataTable();
            List <Combo>   objList          = new List <Combo>();

            objWebService.AuthSoapHdValue      = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.DigoBikashGantabya = gantabyaId.ToInt32();
            objComProjectBO.Lang = Session["LanguageSetting"].ToString();
            dtPopulateSuchak     = objWebService.PopulateDigoBikashSuchak(objComProjectBO);
            if (dtPopulateSuchak != null && dtPopulateSuchak.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtPopulateSuchak.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["DIGO_SUCHAK_ID"].ToInt32(), Name = dr["DIGO_SUCHAK_NAME"].ToString()
                    });
                }
            }
            return(objList);
        }
Example #8
0
        public void FetchPragatiToDashboard(string ministryId, string priorityId, string chaumasikId, string fiscalYearId)
        {
            ProjectService  objWebService     = new ProjectService();
            ComProjectBO    objComProjectBO   = new ComProjectBO();
            DataTable       dtPopulateProject = new DataTable();
            List <barGraph> objList           = new List <barGraph>();

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.Lang          = Session["LanguageSetting"].ToString();
            objComProjectBO.MinistryId    = ministryId.ToInt32();
            objComProjectBO.Priority      = priorityId.ToInt32();
            objComProjectBO.ChaumasikId   = chaumasikId.ToInt32();
            dtPopulateProject             = objWebService.PopulateProjectSamastigatReport(objComProjectBO);
            if (dtPopulateProject != null && dtPopulateProject.Rows.Count > 0)
            {
                foreach (DataRow dr in dtPopulateProject.Rows)
                {
                    objList.Add(new barGraph {
                        Project = dr["PROJECT_NEP_NAME"].ToString(), BhautikProgress = dr["BHAUTIK_PRAGATI"].ToDecimal(), BitiyeProgress = dr["BITIYE_PRAGATI"].ToDecimal()
                    });
                }
            }
            // return objList;

            this.Context.Response.ContentType = "application/json; charset=utf-8";

            this.Context.Response.Write(new JavaScriptSerializer().Serialize(objList).Replace("null", "true"));
        }
Example #9
0
        public List <Combo> FindSubSectorBySectorId(string sectorId)
        {
            SectorService objWebService       = new SectorService();
            ComSubSector  objComSubSector     = new ComSubSector();
            DataTable     dtPopulateSubSector = null;
            List <Combo>  objList             = new List <Combo>();

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationSector();
            objComSubSector.SectorId      = sectorId.ToDecimal();
            objComSubSector.Lang          = Session["LanguageSetting"].ToString();
            dtPopulateSubSector           = objWebService.PopulateSubSectorsBySectorId(objComSubSector);
            if (dtPopulateSubSector != null && dtPopulateSubSector.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtPopulateSubSector.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["ACTIVITY_SUB_SECTOR_ID"].ToInt32(), Name = dr["SUB_SECTOR_NAME"].ToString()
                    });
                }
            }
            return(objList);
        }
Example #10
0
        public List <Combo> FindActivityOutputBySectorID(string sectorId)
        {
            ActivityManagementService wbs = new ActivityManagementService();
            ActivityDetailBO          objActivityDetailBo = new ActivityDetailBO();

            DataTable    dtActivity = null;
            List <Combo> objList    = new List <Combo>();

            wbs.AuthSoapHdValue      = ServiceAuth.ServiceAuthenticationActivity();
            objActivityDetailBo.Lang = Session["LanguageSetting"].ToString();
            objActivityDetailBo.ActivitySubSectorId = sectorId.ToInt32();
            dtActivity = wbs.SelectActivityOutputBySector(objActivityDetailBo);
            if (dtActivity != null && dtActivity.Rows.Count > 0)
            {
                objList.Add(new Combo {
                    ComboId = 0, Name = "छान्नुहोस"
                });
                foreach (DataRow dr in dtActivity.Rows)
                {
                    objList.Add(new Combo {
                        ComboId = dr["activity_output_id"].ToInt32(), Name = dr["activity_output_name"].ToString()
                    });
                }
            }
            return(objList);
        }
Example #11
0
        //protected void btnDownloadFile_Click(object sender, ImageClickEventArgs e)
        //{
        //    string dwldUrl = Constants.ConstantAppPath + "/UserManual/UserManual.pdf";
        //    Response.ContentType = "application/pdf";
        //    Response.AppendHeader("Content-Disposition","attachment; filename=UserManual.pdf");
        //    Response.TransmitFile(Constants.ConstantAppPath + "/UserManual/UserManual.pdf");
        //    Response.End();
        //}

        private string GetOfficeName(int officeId)
        {
            objWebService = new LoginService();
            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationLogin();
            DataTable dtOffice   = objWebService.GetParentOfficeId(officeId);
            string    officeName = dtOffice.Rows[0]["OFFICE_NEP_NAME"].ToString();

            return(officeName);
        }
Example #12
0
        protected void btnSignIn_Click(object sender, EventArgs e)
        {
            DataTable dt = null;

            objComLogin                   = new ComLogin();
            objComLogin.Lang              = Session["LanguageSetting"].ToString();
            objComLogin.Username          = txtUsername.Text;
            objComLogin.Password          = txtPassword.Text;
            objWebService                 = new LoginService();
            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationLogin();
            dt = objWebService.CheckUserExistence(objComLogin);

            if (dt != null && dt.Rows.Count > 0)
            {
                Session["username"]       = dt.Rows[0]["LOGIN_ID"].ToString();
                Session["password"]       = dt.Rows[0]["LOGIN_PASSWORD"].ToString();
                Session["user_id"]        = dt.Rows[0]["user_id"].ToString();
                Session["office_id"]      = dt.Rows[0]["office_id"].ToString();
                Session["role_id"]        = dt.Rows[0]["role_id"].ToString();
                Session["mobile_no"]      = dt.Rows[0]["mobile_no"].ToString();
                Session["email_id"]       = dt.Rows[0]["email_id"].ToString();
                Session["type_id"]        = dt.Rows[0]["TYPE_ID"].ToString();
                Session["fiscal_year_id"] = ddlFiscalYear.SelectedValue.ToInt32();
                Session["fiscal_name"]    = ddlFiscalYear.SelectedItem.Text;
                Session["office_type_id"] = dt.Rows[0]["OFFICE_TYPE_ID"].ToString();
                Session["office_name"]    = GetOfficeName(Session["office_id"].ToInt32());
                ///// ministry_id is assigned 0 for NPC user
                if (Session["office_id"].ToInt32() != 2)// NPC office
                {
                    int pId = Session["office_id"].ToInt32();
                    while (pId != 2)
                    {
                        pId = GetMinistryIdOfUser(pId);
                    }
                    DataTable dtParentOfficeTable = (DataTable)Session["dtParentOfficeTable"];
                    int       ministryId          = dtParentOfficeTable.Rows[0]["OFFICE_ID"].ToInt32();
                    Session["ministry_id"] = ministryId;
                }
                else
                {
                    Session["ministry_id"] = 0;
                }
                Response.Redirect(Constants.ConstantAppPath + "/Home.aspx");
            }
            else
            {
                lblMsg.Text = "Error! Invalid username or password";
            }
        }
Example #13
0
        public void FetchMenu(string id)
        {
            lang = Session["LanguageSetting"].ToString();

            if (id == "#")
            {
                var tree = new JsTreeModel[]
                {
                    new JsTreeModel
                    {
                        text = "Menu",
                        attr = new JsTreeAttribute {
                            id = "0", selected = true
                        }
                    }
                };

                this.Context.Response.ContentType = "application/json; charset=utf-8";

                this.Context.Response.Write(new JavaScriptSerializer().Serialize(tree).Replace("null", "true"));
            }
            else
            {
                DataTable dt    = null;
                var       tree1 = new JsTreeModel[] { };
                objServiceMenu.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationMenu();
                dt = objServiceMenu.FetchMenuHierarchy(int.Parse(id), lang, Session["role_id"].ToInt32());
                if (dt != null && dt.Rows.Count > 0)
                {
                    tree1 = new JsTreeModel[dt.Rows.Count];
                    int i = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        tree1[i] =
                            new JsTreeModel
                        {
                            text = dr["menu_name"].ToString(),
                            attr = new JsTreeAttribute {
                                id = dr["menu_id"].ToString(), selected = true
                            }
                        };
                        i++;
                    }
                }
                this.Context.Response.ContentType = "application/json; charset=utf-8";

                this.Context.Response.Write(new JavaScriptSerializer().Serialize(tree1).Replace("null", "true"));
            }
        }
Example #14
0
        public void FetchOffice(string id)
        {
            if (id == "#")
            {
                var tree = new JsTreeModel[]
                {
                    new JsTreeModel
                    {
                        text = "Office",
                        attr = new JsTreeAttribute {
                            id = "0", selected = true
                        }
                    }
                };

                this.Context.Response.ContentType = "application/json; charset=utf-8";

                this.Context.Response.Write(new JavaScriptSerializer().Serialize(tree).Replace("null", "true"));
            }
            else
            {
                // Base objDal=new Base();
                DataTable dt    = null;
                var       tree1 = new JsTreeModel[] { };
                objServiceOffice.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOffice();
                // dt = objService.FetchOfficeHierarchy(int.Parse(id));
                dt = objServiceOffice.FetchOfficeHierarchy(int.Parse(id));
                if (dt != null && dt.Rows.Count > 0)
                {
                    tree1 = new JsTreeModel[dt.Rows.Count];
                    int i = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        tree1[i] =
                            new JsTreeModel
                        {
                            text = dr["office_nep_name"].ToString(),
                            attr = new JsTreeAttribute {
                                id = dr["office_id"].ToString(), selected = true
                            }
                        };
                        i++;
                    }
                }
                this.Context.Response.ContentType = "application/json; charset=utf-8";

                this.Context.Response.Write(new JavaScriptSerializer().Serialize(tree1).Replace("null", "true"));
            }
        }
Example #15
0
        private void PopulateFiscalYear()
        {
            objComLogin      = new ComLogin();
            objComLogin.Lang = Session["LanguageSetting"].ToString();
            objWebService    = new LoginService();
            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationLogin();
            DataTable dtFiscalYear = objWebService.PopulateFiscalYear(objComLogin);

            Session["dtFiscalYear"] = dtFiscalYear;
            if (dtFiscalYear != null && dtFiscalYear.Rows.Count > 0)
            {
                ddlFiscalYear.DataSource     = dtFiscalYear;
                ddlFiscalYear.DataTextField  = "FISCAL_YEAR";
                ddlFiscalYear.DataValueField = "FISCAL_YEAR_ID";
                ddlFiscalYear.DataBind();
                ddlFiscalYear.Items.Insert(0, "-- आ.व. छान्नुहोस्--");
            }
        }
        private void PopulateProjectsByMinistryId()
        {
            ProjectService objWebService     = new ProjectService();
            ComProjectBO   objComProjectBO   = new ComProjectBO();
            DataTable      dtPopulateProject = new DataTable();

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.Lang          = Session["LanguageSetting"].ToString();
            objComProjectBO.MinistryId    = ddlMinistry.SelectedValue.ToInt32();
            dtPopulateProject             = objWebService.PopulateProjectByMinstryId(objComProjectBO);
            if (dtPopulateProject != null && dtPopulateProject.Rows.Count > 0)
            {
                ddlProject.DataSource     = dtPopulateProject;
                ddlProject.DataTextField  = "PROJECT_NAME";
                ddlProject.DataValueField = "PROJECT_ID";
                ddlProject.DataBind();
            }
        }
Example #17
0
        public string GetBarChartDataBarshik(ComProjectBO obj)
        {
            string         result        = string.Empty;
            ProjectService objWebService = new ProjectService();
            DataSet        ds            = null;
            DataTable      dt            = null;

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            dt     = objWebService.PopulateBarshikChart(obj);
            result = " var BarChartDataBarshik = [";
            foreach (DataRow dr in dt.Rows)
            {
                result = result + "{'projectName':'" + dr["PROJECT_NEP_NAME"] + "','bhautik':" + dr["BHAUTIK_PRAGATI"] + ",'bitiye':" + dr["BITIYE_PRAGATI"] +
                         "},";
            }
            result = result.Substring(0, result.Length - 1);
            result = result + "];";
            return(result);
        }
Example #18
0
        private int GetMinistryIdOfUser(int officeId)
        {
            // int ministryId = officeId;
            objWebService = new LoginService();
            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationLogin();
            DataTable dtParentOfficeTable = objWebService.GetParentOfficeId(officeId);

            Session["dtParentOfficeTable"] = dtParentOfficeTable;
            int pId = dtParentOfficeTable.Rows[0]["PARENT_OFFICE_ID"].ToInt32();

            /* while(pId!=2)
             * {
             *   pId=GetMinistryIdOfUser(pId);
             *   break;
             * }
             *
             * ministryId = dt.Rows[0]["OFFICE_ID"].ToInt32();*/
            return(pId);
        }
Example #19
0
        public void ChangePermission(string menu, string role, string mode, string permission)
        {
            ComMenuRolePermissionBO objBo = new ComMenuRolePermissionBO();

            objBo.AllowAdd                 = mode == "A" ? int.Parse(permission) : 0;
            objBo.AllowEdit                = mode == "E" ? int.Parse(permission) : 0;
            objBo.AllowDelete              = mode == "D" ? int.Parse(permission) : 0;
            objBo.AllowView                = mode == "V" ? int.Parse(permission) : 0;
            objBo.AllowVerifyLevel1        = mode == "VR1" ? int.Parse(permission) : 0;
            objBo.AllowVerifyLevel2        = mode == "VR2" ? int.Parse(permission) : 0;
            objBo.AllowVerifyLevel3        = mode == "VR3" ? int.Parse(permission) : 0;
            objBo.AllowVerifyLevel4        = mode == "VR4" ? int.Parse(permission) : 0;
            objBo.MenuId                   = int.Parse(menu);
            objBo.RoleId                   = int.Parse(role);
            objBo.PermissionMode           = mode;
            objServiceMenu.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationMenu();
            objServiceMenu.ChangePermission(objBo);
            test(menu);
        }
Example #20
0
 public void DeleteMenu(string id)
 {
     objServiceMenu.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationMenu();
     objServiceMenu.DeleteMenu(id);
 }
Example #21
0
        public string GetChartData(int ministryId, string mode, int trimesterId)
        {
            string result = string.Empty;

            ProjectService objWebService   = new ProjectService();
            ComProjectBO   objComProjectBO = new ComProjectBO();

            DataSet   ds = null;
            DataTable dt = null;

            objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationProject();
            objComProjectBO.MinistryId    = ministryId.ToInt32();
            objComProjectBO.FiscalYearId  = SessionHelper.SessionFiscalYear.ToInt32();
            objComProjectBO.Mode          = mode;
            objComProjectBO.ChaumasikId   = trimesterId;
            dt = objWebService.PopulateChartData(objComProjectBO);

            // dt = ds.Tables[0];
            if (mode == "1")
            {
                result = " var chartData = [";
            }
            else if (mode == "2")
            {
                result = " var chartData2 = [";
            }
            else if (mode == "3")
            {
                result = " var chartData3 = [";
            }
            else
            {
            }
            foreach (DataRow dr in dt.Rows)
            {
                if (mode == "2" || mode == "3")
                {
                    if (dr["name"].ToString() == "<50")
                    {
                        result = result + "{'country':'" + dr["name"] + "','value50':" + dr["no"] +
                                 "},";
                    }
                    else if (dr["name"].ToString() == ">50 and <80")
                    {
                        result = result + "{'country':'" + dr["name"] + "','value5080':" + dr["no"] +
                                 "},";
                    }
                    else
                    {
                        result = result + "{'country':'" + dr["name"] + "','value80':" + dr["no"] +
                                 "},";
                    }
                }
                else
                {
                    result = result + "{'country':'" + dr["name"] + "','value':" + dr["no"] +
                             "},";
                }
            }
            result = result.Substring(0, result.Length - 1);
            result = result + "];";
            return(result);
        }
Example #22
0
        public void test(string menuId)
        {
            string    str        = string.Empty;
            DataSet   ds         = null;
            DataTable dt         = null;
            DataTable dtRole     = null;
            string    pathAdd    = string.Empty;
            string    pathRemove = string.Empty;

            pathAdd    = "../../images/wrightMark.gif";
            pathRemove = "../../images/delete.gif";
            string path       = string.Empty;
            string roleId     = string.Empty;
            string permission = string.Empty;

            //string menuId = string.Empty;

            //service autentication
            objServiceMenu.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationMenu();
            //service method call
            ds = objServiceMenu.FetchMenuPermission(int.Parse(menuId), 1);
            //
            str = str + "<table class='table'><tr><td>Role</td><td>Add</td><td>edit</td><td>delete</td><td>View</td></tr>";
            if (ds != null && ds.Tables.Count > 0)
            {
                dt     = ds.Tables[0];
                dtRole = ds.Tables[1];
            }

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    permission = "1";
                    roleId     = dr["role_id"].ToString();
                    str        = str + "<tr><td>" + dr["role_eng_name"] + "</td>";
                    path       = pathRemove;
                    if (dr["allow_add"].ToString() == "1")
                    {
                        path       = pathAdd;
                        permission = "0";
                    }
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'A'," + permission + ")><img src='" + path + "'  /></a></td>";
                    //edit
                    path       = pathRemove;
                    permission = "1";
                    if (dr["allow_edit"].ToString() == "1")
                    {
                        path       = pathAdd;
                        permission = "0";
                    }
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'E'," + permission + ")><img src='" + path + "'  /></a></td>";
                    //delete
                    path       = pathRemove;
                    permission = "1";
                    if (dr["allow_delete"].ToString() == "1")
                    {
                        path       = pathAdd;
                        permission = "0";
                    }
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'D'," + permission + ")><img src='" + path + "'  /></a></td>";
                    //view
                    path       = pathRemove;
                    permission = "1";
                    if (dr["allow_view"].ToString() == "1")
                    {
                        path       = pathAdd;
                        permission = "0";
                    }
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'V'," + permission + ")><img src='" + path + "'  /></a></td>";

                    /*//verify_level1
                     * //view
                     * path = pathRemove;
                     * permission = "1";
                     * if (dr["allow_verify_level_1"].ToString() == "1")
                     * {
                     *  path = pathAdd;
                     *  permission = "0";
                     * }
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId + ",'VR1'," + permission + ")><img src='" + path + "'  /></a></td>";
                     *
                     * //verify_level2
                     * //view
                     * path = pathRemove;
                     * permission = "1";
                     * if (dr["allow_verify_level_2"].ToString() == "1")
                     * {
                     *  path = pathAdd;
                     *  permission = "0";
                     * }
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId + ",'VR2'," + permission + ")><img src='" + path + "'  /></a></td>";
                     * //verify_level_3
                     * //view
                     * path = pathRemove;
                     * permission = "1";
                     * if (dr["allow_verify_level_3"].ToString() == "1")
                     * {
                     *  path = pathAdd;
                     *  permission = "0";
                     * }
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId + ",'VR3'," + permission + ")><img src='" + path + "'  /></a></td>";
                     * //verify_level_4
                     * //view
                     * path = pathRemove;
                     * permission = "1";
                     * if (dr["allow_verify_level_4"].ToString() == "1")
                     * {
                     *  path = pathAdd;
                     *  permission = "0";
                     * }
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId + ",'VR4'," + permission + ")><img src='" + path + "'  /></a></td>";
                     */
                    str = str + "</tr>";
                }
            }
            if (dtRole != null && dtRole.Rows.Count > 0)
            {
                foreach (DataRow dr in dtRole.Rows)
                {
                    path   = pathRemove;
                    roleId = dr["role_id"].ToString();
                    str    = str + "<tr><td>" + dr["role_eng_name"] + "</td>";
                    str    = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                             ",'A'," + 1 + ")><img src='" + path + "'  /></a></td>";
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'E'," + 1 + ")><img src='" + path + "'  /></a></td>";
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'D'," + 1 + ")><img src='" + path + "'  /></a></td>";
                    str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                          ",'V'," + 1 + ")><img src='" + path + "'  /></a></td>";

                    /*str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                     *   ",'VR1'," + 1 + ")><img src='" + path + "'  /></a></td>";
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                     *   ",'VR2'," + 1 + ")><img src='" + path + "'  /></a></td>";
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                     *   ",'VR3'," + 1 + ")><img src='" + path + "'  /></a></td>";
                     * str = str + "<td><a href='javascript:void(0)' onclick=changePermission(" + menuId + "," + roleId +
                     *   ",'VR4'," + 1 + ")><img src='" + path + "'  /></a></td>";*/
                    str = str + "</tr>";
                }
            }
            //dt = objDal.FetchRoles();


            str = str + "</table>";
            this.Context.Response.Write(str);
        }
Example #23
0
 public void DeleteOffice(string id)
 {
     objServiceOffice.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOffice();
     objServiceOffice.DeleteOffice(id);
 }