public List<sp_BankReconciliationResult> GetBankReconciliationData(int ps_AllLocation, string ps_Location, int ps_AllDate, string ps_DateFrom, string ps_DateTo) { string UserLoginId = ""; string[] LocationsIds; try { SECURITY_User _User = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; UserLoginId = _User.User_Id; List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } LocationsIds = UserLocations.Select(c => c.Loc_Id).ToArray(); SCMSDataContext dbSCMS = Connection.Create(); return dbSCMS.sp_BankReconciliation(ps_AllLocation, ps_Location, ps_AllDate, ps_DateFrom, ps_DateTo).ToList().Where(c => LocationsIds.Contains(c.Loc_Id)).ToList(); } catch { return null; } }
/// <summary> /// Use GetAllData Method To Get Voucher Types With Security /// </summary> /// <returns></returns> public List<sp_GetVoucherTypesListResult> GetAllData() { try { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; string UserLoginId = user.User_Id; string UserGroupId = user.UsrGrp_Id; List<sp_GetUserVoucherTypesByUserIdResult> UserVoucherTypes = new DALUserMenuRights().GetUserVoucherTypesByUserId(UserLoginId).ToList(); if (UserVoucherTypes != null && UserVoucherTypes.Count > 0) { UserVoucherTypes = UserVoucherTypes.Where(c => c.SelectedVoucherType != "0").ToList(); } string[] VoucherTypeIds = UserVoucherTypes.Select(c => c.VchrType_Id).ToArray(); SCMSDataContext dbSCMS = Connection.Create(); return dbSCMS.sp_GetVoucherTypesList().ToList().Where(c => VoucherTypeIds.Contains(c.VchrType_Id)).ToList(); } catch { return null; } }
/// <summary> /// This function is used to retreive data in Budget entry console /// </summary> /// <param name="ps_AllLocation"></param> /// <param name="ps_Location"></param> /// <param name="ps_AllBudgetType"></param> /// <param name="ps_BudgetType"></param> /// <param name="ps_AllDate"></param> /// <param name="ps_DateFrom"></param> /// <param name="ps_DateTo"></param> /// <param name="ps_IncludeSecurity"></param> /// <returns></returns> public List<sp_BudgetConsoleResult> GetBudgetEntryConsoleData(int pi_AllLocation, string ps_Location) { try { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; string UserLoginId = user.User_Id; string UserGroupId = user.UsrGrp_Id; string[] LocationsIds; SCMSDataContext dbSCMS = Connection.Create(); if (pi_AllLocation == 1) { List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } LocationsIds = UserLocations.Select(c => c.Loc_Id).ToArray(); } else { LocationsIds = new string[1]; LocationsIds[0] = ps_Location; } //return dbSCMS.sp_BudgetConsole(ps_AllLocation, ps_Location).ToList().Where(c => LocationsIds.Contains(c.Loc_Id) && _Status.Contains(c.BgdtMas_Status)).ToList(); return dbSCMS.sp_BudgetConsole().ToList().Where(c => LocationsIds.Contains(c.Loc_Id)).ToList(); } catch (Exception ex) { return null; } }
// Use for the drop downs to implement Security public List<sp_PopulateLocationListResult> PopulateData() { try { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; string UserLoginId = user.User_Id; string UserGroupId = user.UsrGrp_Id; List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } string[] LocationsIds = UserLocations.Select(c => c.Loc_Id).ToArray(); SCMSDataContext dbSCMS = Connection.Create(); return dbSCMS.sp_PopulateLocationList().ToList().Where(c => LocationsIds.Contains(c.Loc_Id)).ToList(); } catch { return null; } }
/// <summary> /// This function is used to retreive data in voucher entry console /// </summary> /// <param name="ps_AllLocation"></param> /// <param name="ps_Location"></param> /// <param name="ps_AllVoucherType"></param> /// <param name="ps_VoucherType"></param> /// <param name="ps_AllDate"></param> /// <param name="ps_DateFrom"></param> /// <param name="ps_DateTo"></param> /// <param name="ps_IncludeSecurity"></param> /// <returns></returns> public List<sp_VoucherEntryConsoleResult> GetVoucherEntryConsoleData(int ps_AllLocation, string ps_Location, int ps_AllVoucherType, string ps_VoucherType, int ps_AllDate, string ps_DateFrom, string ps_DateTo, bool ps_IncludeSecurity) { try { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; string UserLoginId = user.User_Id; string UserGroupId = user.UsrGrp_Id; string _Status = "Pending"; List<sp_GetUserVoucherTypesByUserIdResult> UserVoucherTypes = new DALUserMenuRights().GetUserVoucherTypesByUserId(UserLoginId).ToList(); if (UserVoucherTypes != null && UserVoucherTypes.Count > 0) { UserVoucherTypes = UserVoucherTypes.Where(c => c.SelectedVoucherType != "0").ToList(); } string[] VoucherTypeIds = UserVoucherTypes.Select(c => c.VchrType_Id).ToArray(); List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } string[] LocationsIds = UserLocations.Select(c => c.Loc_Id).ToArray(); SCMSDataContext dbSCMS = Connection.Create(); if (ps_IncludeSecurity == true) { //return dbSCMS.sp_VoucherEntryConsole(ps_AllLocation, ps_Location, ps_AllVoucherType, ps_VoucherType, ps_AllDate, ps_DateFrom, ps_DateTo).ToList().Where(c => VoucherTypeIds.Contains(c.VchrType_Id) && LocationsIds.Contains(c.Loc_Id) && _Status.Contains (c.VchMas_Status) ).ToList(); return dbSCMS.sp_VoucherEntryConsole(ps_AllLocation, ps_Location, ps_AllVoucherType, ps_VoucherType, ps_AllDate, ps_DateFrom, ps_DateTo).ToList().Where(c => VoucherTypeIds.Contains(c.VchrType_Id) && LocationsIds.Contains(c.Loc_Id) ).ToList(); } else { return dbSCMS.sp_VoucherEntryConsole(ps_AllLocation, ps_Location, ps_AllVoucherType, ps_VoucherType, ps_AllDate, ps_DateFrom, ps_DateTo).ToList(); } } catch { return null; } }
public string SetParam_BalanceSheet(string ps_ReportName, string pi_AllLoc, string ps_Location, Int32 pi_Level, Int32 pi_Year) { string ls_Location = ""; ResetParameters(); Reports.ReportParameters.ReportName = ps_ReportName; Reports.ReportParameters.Level = pi_Level; Reports.ReportParameters.Year = pi_Year; if (pi_AllLoc == "1") { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; UserLoginId = user.User_Id; List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } ls_Location = ConvertStringArrayToString(UserLocations.Select(c => c.Loc_Id).ToArray()); if (ls_Location == null || ls_Location.Trim() == "") { ls_Location = "''"; } Reports.ReportParameters.Location = ls_Location; } else { Reports.ReportParameters.Location = ps_Location; } return "OK"; }
public string SetParam_VoucherDocument(string ps_ReportName, string pi_AllLoc, string ps_Location, string pi_AllVchrType, string ps_VoucherTypes, string pi_AllDoc, string ps_DocFrom, string ps_DocTo, string pi_AllVchrStatus, string ps_VchrStatus, string pi_AllDate, DateTime pdt_DateFrom, DateTime pdt_DateTo, string ps_VoucherPrint) { string ls_Location = "", ls_VoucherTypes = ""; ResetParameters(); Reports.ReportParameters.ReportName = ps_ReportName; Reports.ReportParameters.VoucherPrint = ps_VoucherPrint; if (pi_AllLoc == "1") { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; UserLoginId = user.User_Id; List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } ls_Location = ConvertStringArrayToString(UserLocations.Select(c => c.Loc_Id).ToArray()); if (ls_Location == null || ls_Location.Trim() == "") { ls_Location = "''"; } Reports.ReportParameters.Location = ls_Location; } else { Reports.ReportParameters.Location = ps_Location; } if (pi_AllVchrType == "1") { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; UserLoginId = user.User_Id; List<sp_GetUserVoucherTypesByUserIdResult> UserVoucherTypes = new DALUserMenuRights().GetUserVoucherTypesByUserId(UserLoginId).ToList(); if (UserVoucherTypes != null && UserVoucherTypes.Count > 0) { UserVoucherTypes = UserVoucherTypes.Where(c => c.SelectedVoucherType != "0").ToList(); } ls_VoucherTypes = ConvertStringArrayToString(UserVoucherTypes.Select(c => c.VchrType_Id).ToArray()); if (ls_VoucherTypes == null || ls_VoucherTypes.Trim() == "") { ls_VoucherTypes = "''"; } Reports.ReportParameters.VoucherTypes = ls_VoucherTypes; } else { Reports.ReportParameters.VoucherTypes = ps_VoucherTypes; } if (pi_AllDoc == "1") { Reports.ReportParameters.AllDoc = 1; Reports.ReportParameters.DocFrom = ""; Reports.ReportParameters.DocTo = ""; } else { Reports.ReportParameters.AllDoc = 0; Reports.ReportParameters.DocFrom = ps_DocFrom; Reports.ReportParameters.DocTo = ps_DocTo; } if (pi_AllVchrStatus == "1") { Reports.ReportParameters.AllVchrStatus = 1; Reports.ReportParameters.VoucherStatus = ""; } else { Reports.ReportParameters.AllVchrStatus = 0; Reports.ReportParameters.VoucherStatus = ps_VchrStatus; } if (pi_AllDate == "1") { Reports.ReportParameters.AllDate = 1; Reports.ReportParameters.DateFrom = Convert.ToDateTime("01/01/1900"); Reports.ReportParameters.DateTo = Convert.ToDateTime("01/01/1900"); } else { Reports.ReportParameters.AllDate = 0; Reports.ReportParameters.DateFrom = pdt_DateFrom; Reports.ReportParameters.DateTo = pdt_DateTo; } return "OK"; }
public string SetParam_TrialBalance(String ps_ReportName, string pi_AllLoc, String ps_Location, string pi_AllAccCode, string ps_AccCodeFrom, string ps_AccCodeTo, string pi_AllDate, DateTime pdt_DateFrom, DateTime pdt_DateTo, string ps_Level, string ps_TrialActivity) { string ls_Location = ""; ResetParameters(); Reports.ReportParameters.ReportName = ps_ReportName; Reports.ReportParameters.Level = Convert.ToInt32(ps_Level); Reports.ReportParameters.TrialActivity = ps_TrialActivity; if (pi_AllLoc == "1") { SECURITY_User user = (SECURITY_User)System.Web.HttpContext.Current.Session["user"]; UserLoginId = user.User_Id; List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserLoginId).ToList(); if (UserLocations != null && UserLocations.Count > 0) { UserLocations = UserLocations.Where(c => c.SelectedLocation != "0").ToList(); } ls_Location = ConvertStringArrayToString(UserLocations.Select(c => c.Loc_Id).ToArray()); if (ls_Location == null || ls_Location.Trim() == "") { ls_Location = "''"; } Reports.ReportParameters.Location = ls_Location; } else { Reports.ReportParameters.Location = ps_Location; } if (pi_AllAccCode == "1") { Reports.ReportParameters.AllAccCode = 1; Reports.ReportParameters.AccCodeFrom = ""; Reports.ReportParameters.AccCodeTo = ""; } else { Reports.ReportParameters.AllAccCode = 0; Reports.ReportParameters.AccCodeFrom = ps_AccCodeFrom; Reports.ReportParameters.AccCodeTo = ps_AccCodeTo; } if (pi_AllDate == "1") { Reports.ReportParameters.AllDate = 1; Reports.ReportParameters.DateFrom = pdt_DateFrom; Reports.ReportParameters.DateTo = pdt_DateTo; } else { Reports.ReportParameters.AllDate = 0; Reports.ReportParameters.DateFrom = pdt_DateFrom; Reports.ReportParameters.DateTo = pdt_DateTo; } return "OK"; }