private void LoadList() { Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; if (oConfig != null) { Screen oScr = new Screen(); ScreenDAL oScrDAL = new ScreenDAL(); Result oResult = oScrDAL.LoadUnapprovedList(oConfig.UserName, false); gvData.DataSource = null; gvData.DataBind(); if (oResult.Status) { DataTable dtTmpList = (DataTable)oResult.Return; if (dtTmpList.Rows.Count > 0) { dtTmpList.Columns.Remove("MakerID"); gvData.DataSource = dtTmpList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList; } else { ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Delete"), true); } } else { ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Delete"), true); } } else { ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Delete"), true); } }
protected void SearchAction() { string sType = Request.QueryString["pType"]; Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; gvData.DataSource = null; gvData.DataBind(); if (!string.IsNullOrEmpty(sType)) { Session[Constants.SES_SA_UNAPPROVE_DATA] = new DataTable(); if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_SA.USER).PadLeft(5, '0'))) { lgText.InnerHtml = "User Approval Queue List"; UserDAL oUserDAL = new UserDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'User' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oUserDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpList = (DataTable)oResult.Return; if (dtTmpList != null) { if (dtTmpList.Rows.Count > 0) { gvData.DataSource = dtTmpList; gvData.DataBind(); Session[Constants.SES_SA_UNAPPROVE_DATA] = dtTmpList; } } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_SA.DEPARTMENT).PadLeft(5, '0'))) { lgText.InnerHtml = "Department Approval Queue List"; DepartmentDAL oDptDAL = new DepartmentDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Department' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oDptDAL.LoadUnapprovedList(null, true); DataTable dtTmpList = (DataTable)oResult.Return; if (dtTmpList != null) { gvData.DataSource = dtTmpList; gvData.DataBind(); Session[Constants.SES_SA_UNAPPROVE_DATA] = dtTmpList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_SA.DESIGNATION).PadLeft(5, '0'))) { lgText.InnerHtml = "Designation Approval Queue List"; DesignationDAL oDsgDAL = new DesignationDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Designation' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oDsgDAL.LoadUnapprovedList(null, true); DataTable dtTmpDsgList = (DataTable)oResult.Return; if (dtTmpDsgList != null) { gvData.DataSource = dtTmpDsgList; gvData.DataBind(); Session[Constants.SES_SA_UNAPPROVE_DATA] = dtTmpDsgList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_SA.SECURITY_POLICY).PadLeft(5, '0'))) { lgText.InnerHtml = "Security policy Approval Queue List"; SecurityPolicyDAL oSPDAL = new SecurityPolicyDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Security policy' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oSPDAL.LoadUnapprovedList(null, true); DataTable dtTmpSPList = (DataTable)oResult.Return; if (dtTmpSPList != null) { gvData.DataSource = dtTmpSPList; gvData.DataBind(); Session[Constants.SES_SA_UNAPPROVE_DATA] = dtTmpSPList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_SA.GROUP_PERMISSION).PadLeft(5, '0'))) { lgText.InnerHtml = "Group Permission Approval Queue List"; GroupDAL oGPDAL = new GroupDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Group Permission' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oGPDAL.LoadUnapprovedList(null, true); DataTable dtTmpSPList = (DataTable)oResult.Return; if (dtTmpSPList != null) { gvData.DataSource = dtTmpSPList; gvData.DataBind(); Session[Constants.SES_SA_UNAPPROVE_DATA] = dtTmpSPList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_SA.SCREEN_SETUP).PadLeft(5, '0'))) { lgText.InnerHtml = "Screen Setup Approval Queue List"; ScreenDAL sCRDAL = new ScreenDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Screen Setup' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = sCRDAL.LoadUnapprovedList(null, true); DataTable dtTmpSPList = (DataTable)oResult.Return; if (dtTmpSPList != null) { gvData.DataSource = dtTmpSPList; gvData.DataBind(); Session[Constants.SES_SA_UNAPPROVE_DATA] = dtTmpSPList; } } } }