Пример #1
0
        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;
            }
        }
Пример #2
0
 public string GetUserLocations(string GroupId, string UserId)
 {
     List<sp_GetUserLocationsByUserIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByUserId(UserId).ToList();
     string response = "";
     response += "<table id='LocationGrid' class='display' style='width: 100%; padding: 2px;'>";
     response += "<thead>";
     response += "<tr class='odd gradeX' style='line-height: 15px; cursor: pointer; text-align: left;";
     response += "background-color: #ccc;'>";
     response += "<th style='vertical-align: middle; width: 90%; padding-left: 3px;'>";
     response += "Location";
     response += "</th>";
     response += "<th style='vertical-align: middle; width: 10%;'>";
     response += "Is Allowed";
     response += "</th>";
     response += "</tr>";
     response += "</thead>";
     response += "<tbody>";
     foreach (SCMSDataLayer.DB.sp_GetUserLocationsByUserIdResult location in UserLocations)
     {
         response += " <tr class='odd gradeX' style='line-height: 15px; cursor: pointer;'>";
         response += "<td style='vertical-align: middle; width: 25%;'>";
         response += location.Loc_Title;
         response += "</td>";
         response += "<td style='vertical-align: middle;'>";
         response += "<input type='checkbox' class='allowedloc' id='" + location.Loc_Id + "' ";
         response += location.SelectedLocation == "0" ? "" : "checked='checked'" + "/>";
         response += "</td>";
         response += "</tr>";
     }
     response += "</tbody>";
     response += "</table>";
     return response;
 }
Пример #3
0
 public string GetUserChartOfAccounts(string GroupId, string UserId)
 {
     List<sp_GetUserChartOfAccountByUserIdResult> UserChartOfAccounts = new DALUserMenuRights().GetUserChartOfAccountByUserId(UserId).ToList();
     string response = "";
     response += "<table id='ChartOfAccountGrid' class='display' style='width: 100%; padding: 2px;'>";
     response += "<thead>";
     response += "<tr class='odd gradeX' style='line-height: 15px; cursor: pointer; text-align: left;";
     response += "background-color: #ccc;'>";
     response += "<th style='vertical-align: middle; width: 25%; padding-left: 3px;'>";
     response += " Code";
     response += "</th>";
     response += "<th style='vertical-align: middle; width: 25%; padding-left: 3px;'>";
     response += " Chart Of Account";
     response += "</th>";
     response += "<th style='vertical-align: middle; width: 25%; padding-left: 3px;'>";
     response += " Type";
     response += "</th>";
     response += "<th style='vertical-align: middle; width: 25%;'>";
     response += "<input type='checkbox' id='chk_AllCOA' onclick='SelectAllCOA(this);' style='margin-bottom:5px;margin-right:1px;margin-left:4px;' /> Is Allowed";
     response += "</th>";
     response += "</tr>";
     response += "</thead>";
     response += "<tbody>";
     foreach (SCMSDataLayer.DB.sp_GetUserChartOfAccountByUserIdResult coa in UserChartOfAccounts)
     {
         response += " <tr class='odd gradeX' style='line-height: 15px; cursor: pointer; " + (coa.ChrtAcc_Type == 1 ? "font-weight:bold" : "") + "'>";
         response += "<td style='vertical-align: middle; width: 25%;'>";
         response += coa.ChrtAcc_CodeDisplay;
         response += "</td>";
         response += "<td style='vertical-align: middle; width: 25%;'>";
         response += coa.ChrtAcc_Title;
         response += "</td>";
         response += "<td style='vertical-align: middle; width: 25%;'>";
         response += coa.ChrtAcc_Type == 1 ? "Group" : "Detail";
         response += "</td>";
         response += "<td style='vertical-align: middle;'>";
         response += "<input type='checkbox' class='allowedCOA' id='" + coa.ChrtAcc_Id + "' value='' ";
         response += (coa.SelectedChartOfAccount == "0" ? "" : "checked='checked'") + "/>";
         response += "</td>";
         response += "</tr>";
     }
     response += "</tbody>";
     response += "</table>";
     return response;
 }
Пример #4
0
        /// <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;
            }
        }
Пример #5
0
        /// <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;
            }
        }
Пример #6
0
 public string SetUserVoucherTypes(string GroupId, string UserId, bool isGroup, string UserVoucherTypes)
 {
     try
     {
         string[] UserVoucherTypeIds = UserVoucherTypes.Split(',');
         DALUserMenuRights objUserMenuRights = new DALUserMenuRights();
         int Success = objUserMenuRights.DeleteVoucherTypesByGroupId(GroupId, UserId);
         if (Success >= 0)
         {
             foreach (string userVoucherTypeId in UserVoucherTypeIds)
             {
                 Security_UserVoucherType userVoucherTypeRow = new Security_UserVoucherType();
                 userVoucherTypeRow.UserGrp_Id = GroupId.ToString();
                 if (UserId != null)
                 {
                     userVoucherTypeRow.User_Id = UserId.ToString();
                 }
                 userVoucherTypeRow.VchrType_Id = userVoucherTypeId;
                 objUserMenuRights.SetUserVoucherTypes(userVoucherTypeRow);
             }
         }
         return "1";
     }
     catch
     {
         return "0";
     }
 }
Пример #7
0
 public string SetUserLocations(string GroupId, string UserId, bool isGroup, string UserLocations)
 {
     try
     {
         string[] UserLocationIds = UserLocations.Split(',');
         DALUserMenuRights objUserMenuRights = new DALUserMenuRights();
         int Success = objUserMenuRights.DeleteLocationsByGroupId(GroupId, UserId);
         if (Success >= 0)
         {
             foreach (string userLocationId in UserLocationIds)
             {
                 Security_UserLocation userLocationRow = new Security_UserLocation();
                 userLocationRow.UsrGrp_Id = GroupId.ToString();
                 if (UserId != null)
                 {
                     userLocationRow.User_Id = UserId.ToString();
                 }
                 userLocationRow.Loc_Id = userLocationId;
                 objUserMenuRights.SetUserLocations(userLocationRow);
             }
         }
         return "1";
     }
     catch
     {
         return "0";
     }
 }
Пример #8
0
        public string SetUserChartOfAccount(String GroupId, String UserId, Boolean isGroup, String UserChartOfAccounts)
        {
            try
            {
                //string GroupId = "";
                //string UserId = "";
                //bool isGroup = false;
                //string UserChartOfAccounts = "";

                string[] UserChartOfAccountIds = UserChartOfAccounts.Split(',');
                DALUserMenuRights objUserMenuRights = new DALUserMenuRights();
                int Success = objUserMenuRights.DeleteChartOfAccountsByGroupId(GroupId, UserId);
                if (Success >= 0)
                {
                    foreach (string userChartOfAccountId in UserChartOfAccountIds)
                    {
                        Security_UserChartOfAccount userChartOfAccountRow = new Security_UserChartOfAccount();
                        userChartOfAccountRow.UserGrp_Id = GroupId.ToString();
                        if (UserId != null)
                        {
                            userChartOfAccountRow.User_Id = UserId.ToString();
                        }
                        userChartOfAccountRow.ChrtAcc_Id = userChartOfAccountId;
                        objUserMenuRights.SetUserChartOfAccount(userChartOfAccountRow);
                    }
                }
                return "1";
            }
            catch
            {
                return "0";
            }
        }
Пример #9
0
 public string SaveUserRights(int GroupId, int? UserId, bool isGroup, string UserMenus)
 {
     try
     {
         string[] UserMenuIds = UserMenus.Split(',');
         DALUserMenuRights objUserMenuRights = new DALUserMenuRights();
         int Success = objUserMenuRights.DeleteRecordByGroupId(GroupId, UserId, SystemParameters.ModuleId);
         if (Success >= 0)
         {
             foreach (string userMenuId in UserMenuIds)
             {
                 Security_UserRight userRightRow = new Security_UserRight();
                 string Code = "";
                 if (DALCommon.AutoCodeGeneration("Security_UserRights") == 1)
                 {
                     Code = DALCommon.GetMaximumCode("Security_UserRights");
                 }
                 userRightRow.UsrSec_Code = Code;
                 userRightRow.Grp_Id = GroupId;
                 if (UserId != null)
                 {
                     userRightRow.UsrSec_UserId = UserId.ToString();
                 }
                 string[] cols = userMenuId.Split('~');
                 userRightRow.Mnu_Id = Convert.ToInt32(cols[0]);
                 userRightRow.UsrSec_Add = Convert.ToBoolean(cols[1]);
                 userRightRow.UsrSec_Edit = Convert.ToBoolean(cols[2]);
                 userRightRow.UsrSec_Delete = Convert.ToBoolean(cols[3]);
                 userRightRow.UsrSec_Print = Convert.ToBoolean(cols[4]);
                 userRightRow.UsrSec_Import = Convert.ToBoolean(cols[5]);
                 userRightRow.Mod_Id = SystemParameters.ModuleId;
                 objUserMenuRights.SaveRecord(userRightRow);
             }
         }
         return "1";
     }
     catch
     {
         return "0";
     }
 }
Пример #10
0
 //
 // GET: /UserRightsSetup/
 public ActionResult Index()
 {
     List<sp_GetUserGroupListResult> userGroups = new DALUserGroup().GetAllData().ToList();
     ViewData["ddl_UserGroups"] = new SelectList(userGroups, "UsrGrp_Id", "UsrGrp_Title");
     List<sp_GetUserMenuRightsResult> MenuRights = new DALUserMenuRights().GetUserMenuRights("").Where(c => c.Mod_Id == SystemParameters.ModuleId && c.Mnu_Level != "0").ToList();
     List<sp_GetUserLocationsByGroupIdResult> UserLocations = new DALUserMenuRights().GetUserLocationsByGroupId("").ToList();
     List<sp_GetUserVoucherTypesByGroupIdResult> UserVouchers = new DALUserMenuRights().GetUserVoucherTypesByGroupId("").ToList();
     List<sp_GetUserChartOfAccountByGroupIdResult> UserChartOfAccounts = new DALUserMenuRights().GetUserChartOfAccountByGroupId("").ToList();
     List<sp_GetUserListResult> Users = new DALUser().GetAllData().ToList();
     ViewData["UserMenuRights"] = MenuRights;
     ViewData["UserLocations"] = UserLocations;
     ViewData["UserVoucherTypes"] = UserVouchers;
     ViewData["UserChartOfAccount"] = UserChartOfAccounts;
     ViewData["AllUsers"] = Users;
     return View("UserRights");
 }
Пример #11
0
        public string GetUserMenus(string GroupId, string UserId)
        {
            List<sp_GetUserMenuRightsByUserIdResult> MenuRights = new DALUserMenuRights().GetUserMenuRightsByUserId(Convert.ToInt32(UserId).ToString()).Where(c => c.Mod_Id == SystemParameters.ModuleId && c.Mnu_Level != "0").ToList();
            string response = "";
            response += "<table id='MenuGrid' class='display' style='width: 100%; padding: 2px;'>";
            response += "<thead>";
            response += "<tr class='odd gradeX' style='line-height: 15px; cursor: pointer; text-align: left;";
            response += "background-color: #ccc;'>";
            response += "<th style='vertical-align: middle; width: 30%; padding-left: 3px;'>";
            response += "Menu Description";
            response += "</th>";
            response += "<th style='vertical-align: middle; width: 10%;'>";
            response += "Is Allowed";
            response += "</th>";
            response += "<th style='vertical-align: middle; width: 10%;'>";
            response += "Can Add";
            response += "</th>";
            response += "<th style='vertical-align: middle; width: 10%;'>";
            response += "Can Edit";
            response += "</th>";
            response += "<th style='vertical-align: middle; width: 10%;'>";
            response += "Can Delete";
            response += "</th>";
            response += "<th style='vertical-align: middle; width: 10%;'>";
            response += "Can Print";
            response += "</th>";
            response += "<th style='vertical-align: middle; width: 10%;'>";
            response += "Can Import";
            response += "</th>";
            response += "</tr>";
            response += "</thead>";
            response += "<tbody>";
            int count = 0;
            foreach (SCMSDataLayer.DB.sp_GetUserMenuRightsByUserIdResult menuRight in MenuRights)
            {
                count++;
                string node = menuRight.Mnu_Level.Contains(".") ? "Child" : "Parent";

                response += "<tr class='odd gradeX' style='line-height: 15px; cursor: pointer;'>";
                if (node == "Parent")
                {
                    response += "<th style='vertical-align: middle; text-align: left; padding-left: 3px;'>";
                    response += menuRight.Mnu_Description;
                    response += "</th>";
                }
                else
                {
                    response += "<td style='vertical-align: middle; padding-left: 50px;'>";
                    response += menuRight.Mnu_Description;
                    response += "</td>";
                }
                response += "<td style='vertical-align: middle;'>";
                response += "<input type='checkbox' class='allowed' value='ChkDesc" + menuRight.Mnu_Level + "' id='ChkDesc" + menuRight.Mnu_Id + "'";
                response += menuRight.SelectedMenu == 0 ? "" : "checked='checked'" + "/>";
                response += "</td>";
                if (menuRight.Mnu_Level == "3" || menuRight.Mnu_Level.Contains("3."))
                {
                    response += "<td></td>";
                    response += "<td></td>";
                    response += "<td></td>";
                    response += "<td></td>";
                    response += "<td></td>";
                }
                else
                {
                    response += "<td style='vertical-align: middle;'>";
                    response += "<input type='checkbox' class='add' value='ChkAdd" + menuRight.Mnu_Level + "' id='ChkAdd" + menuRight.Mnu_Id + "'";
                    response += menuRight.CanAdd == false ? "" : "checked='checked'" + "/>";
                    response += "</td>";
                    response += "<td style='vertical-align: middle;'>";
                    response += "<input type='checkbox' class='edit' value='ChkEdit" + menuRight.Mnu_Level + "' id='ChkEdit" + menuRight.Mnu_Id + "'";
                    response += menuRight.CanEdit == false ? "" : "checked='checked'" + "/>";
                    response += "</td>";
                    response += "<td style='vertical-align: middle;'>";
                    response += "<input type='checkbox' class='delete' value='ChkDelete" + menuRight.Mnu_Level + "'";
                    response += "id='ChkDelete" + menuRight.Mnu_Id + "'";
                    response += menuRight.CanDelete == false ? "" : "checked='checked'" + "/>";
                    response += "</td>";
                    response += "<td style='vertical-align: middle;'>";
                    response += "<input type='checkbox' class='print' value='ChkPrint" + menuRight.Mnu_Level + "' id='ChkPrint" + menuRight.Mnu_Id + "'";
                    response += menuRight.CanPrint == false ? "" : "checked='checked'" + "/>";
                    response += "</td>";
                    response += "<td style='vertical-align: middle;'>";
                    response += "<input type='checkbox' class='import' value='ChkImport" + menuRight.Mnu_Level + "'";
                    response += "id='ChkImport" + menuRight.Mnu_Id + "'";
                    response += menuRight.CanImport == false ? "" : "checked='checked'" + "/>";
                    response += "</td>";
                }
                response += "</tr>";
            }
            response += "</tbody>";
            response += "</table>";
            return response;
        }
Пример #12
0
        // 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;
            }
        }
Пример #13
0
        /// <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";
        }