Ejemplo n.º 1
0
 /// <summary>
 /// Get all available budgets in the application
 /// </summary>
 /// <param name="userId">User ID</param>
 /// <returns>Set of available budgets </returns>
 public DataSet GetAvailableBudgets(string userId)
 {
     object[] objUserCredentials = new object[2];
     objUserCredentials[0] = userId;
     objUserCredentials[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objUserCredentials, "bspViewBudget"));
 }
 /// <summary>
 /// Get User Details
 /// </summary>
 /// <param name="userId">User Id</param>
 /// <returns>Data set</returns>
 public DataSet GetUserDetails(string userId)
 {
     object[] objUserDetails = new object[2];
     objUserDetails[0] = userId;
     objUserDetails[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objUserDetails, "bspGetUserDetailsForFriendInvitation"));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Get the account settings data
 /// </summary>
 /// <param name="userId">Logged In User Id</param>
 /// <param name="companyId">Users company</param>
 /// <returns>Data set</returns>
 public DataSet GetAccountSettingsData(string userId, long?companyId)
 {
     companyId = userSession.CompanyId;
     object[] objAccountInputParameter = new object[2];
     objAccountInputParameter[0] = userId;
     objAccountInputParameter[1] = companyId;
     return(DataLibrary.ExecuteDataSet(ref objAccountInputParameter, "bspGetAccountSettingsData"));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Get transaction lookup data
 /// </summary>
 /// <param name="lookupType">Lookup type</param>
 /// <param name="lookupCondition">Look up condition</param>
 /// <returns></returns>
 public DataSet GetTransactionLookUpData(char lookupType, string lookupCondition)
 {
     object[] expenseDetails = new object[3];
     expenseDetails[0] = lookupType;
     expenseDetails[1] = lookupCondition;
     expenseDetails[2] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref expenseDetails, "bspGetTransactionLookUpData"));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Get User group Details by Userid
        /// </summary>
        /// <returns>User Group Data</returns>
        public DataSet GetUserGroups()
        {
            object[] objUserGroup = new object[1];
            objUserGroup[0] = userSession.CompanyId;
            DataSet userPermissionDataSet = DataLibrary.ExecuteDataSet(ref objUserGroup, "bspGetUSerGroup");

            return(userPermissionDataSet);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Get the list of application users
        /// </summary>
        /// <returns>Dataset</returns>
        public DataSet GetAllApplicationUsers()
        {
            object[] objUserParameter = new object[1];
            objUserParameter[0] = userSession.CompanyId;
            DataSet userPermissionDataSet = DataLibrary.ExecuteDataSet(ref objUserParameter, "bspGetApplicationUsers");

            return(userPermissionDataSet);
        }
 /// <summary>
 /// Get Users by user name
 /// </summary>
 /// <param name="userName">User Name</param>
 /// <param name="loggedInUserId">Logged In User Id</param>
 /// <returns>Dataset</returns>
 public DataSet GetUsers(string userName, string loggedInUserId)
 {
     object[] objGetUsersByUserName = new object[3];
     objGetUsersByUserName[0] = userName;
     objGetUsersByUserName[1] = loggedInUserId;
     objGetUsersByUserName[2] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objGetUsersByUserName, "bspGetUsersByUserName"));
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Get the required data for the user permisssion screen
        /// </summary>
        /// <returns>Dataset</returns>
        public DataSet GetUserPermissions(string sessionId, bool showUserList = false)
        {
            object[] objUserPermissions = new object[3];
            objUserPermissions[0] = sessionId;
            objUserPermissions[1] = showUserList;
            objUserPermissions[2] = userSession.CompanyId;
            DataSet userPermissionDataSet = DataLibrary.ExecuteDataSet(ref objUserPermissions, "bspGetUserPermissions");

            return(userPermissionDataSet);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Get result set from analysis.
        /// </summary>
        /// <param name="analysisQuery">Analysis query entity.</param>
        /// <returns>Analysis result set.</returns>
        public DataSet GetAnalysisData(AnalysisQuery analysisQuery)
        {
            object[] objAnalysisQueryParams = new object[8];

            objAnalysisQueryParams[0] = analysisQuery.User1;
            objAnalysisQueryParams[1] = analysisQuery.User2;
            objAnalysisQueryParams[2] = analysisQuery.GroupId;
            objAnalysisQueryParams[3] = analysisQuery.ExpenseId;
            objAnalysisQueryParams[4] = analysisQuery.From;
            objAnalysisQueryParams[5] = analysisQuery.To;
            objAnalysisQueryParams[6] = analysisQuery.Action;
            objAnalysisQueryParams[7] = userSession.CompanyId;

            return(DataLibrary.ExecuteDataSet(ref objAnalysisQueryParams, "bspGetAnalysisData"));
        }
Ejemplo n.º 10
0
 /// <summary>
 /// To add the user to the application
 /// </summary>
 /// <returns>Bool</returns>
 public bool AddUser(string userName, string password, string emailId, string displayName)
 {
     object[] objAddUserParameters = new object[4];
     objAddUserParameters[0] = userName;
     objAddUserParameters[1] = encDecryption.Encrypt(password);
     objAddUserParameters[2] = emailId;
     objAddUserParameters[3] = displayName;
     System.Data.DataSet execResult = DataLibrary.ExecuteDataSet(ref objAddUserParameters, "bspAddUser");
     if (execResult.Tables.Count == 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Check whether the user name already exists or not
 /// </summary>
 /// <param name="UserName">chosen user name </param>
 /// <returns>return boolean value either true or false; if true user name exists else not exists.</returns>
 public bool CheckUserNameOrEmailIsExists(string userNameOrEmail, string fieldType = "Name")
 {
     object[] objUserCredentials = new object[2];
     objUserCredentials[0] = userNameOrEmail;
     objUserCredentials[1] = fieldType;
     System.Data.DataSet userData = DataLibrary.ExecuteDataSet(ref objUserCredentials, "bspCheckUserNameOrEmailIsExists");
     if (userData.Tables.Count > 0)
     {
         if (userData.Tables[0].Rows.Count > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// To check whether the user is a valid user
        /// </summary>
        /// <param name="UserName">User name</param>
        /// <param name="Password">password</param>
        /// <returns></returns>
        public bool CheckIsValidUser(string UserName, string Password)
        {
            object[] objUserCredentials = new object[2];
            objUserCredentials[0] = UserName;
            objUserCredentials[1] = encDecryption.Encrypt(Password);
            System.Data.DataSet userData = DataLibrary.ExecuteDataSet(ref objUserCredentials, "bspAuthorizeUserLogIn");
            if (userData.Tables.Count > 0)
            {
                if (userData.Tables[0].Rows.Count > 0)
                {
                    DataTable userDataTable = userData.Tables[0];

                    var resultSet = userDataTable.AsEnumerable().Select(result => new { UserName = result.Field <string>("userid"), DisplayName = result.Field <string>("DisplayName"), CompanyId = result.Field <int?>("CompanyId") }).FirstOrDefault();
                    Resources.DisplayName = resultSet.DisplayName;
                    userSession.SetSession("CompanyId", resultSet.CompanyId);
                    userSession.SetSession("DisplayName", resultSet.DisplayName);
                    userData      = null;
                    userDataTable = null;
                    if (UserName.ToLower() == resultSet.UserName.ToLower())
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Get the navigation links for the logged in user
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <returns><see cref="UserMenu"/></returns>
        public IEnumerable <UserMenu> GetLoggedInUserScreens(string userId)
        {
            object[] objUserId = new object[2];
            objUserId[0] = userId;
            objUserId[1] = userSession.CompanyId;
            DataSet userMenuDataSet         = DataLibrary.ExecuteDataSet(ref objUserId, "bspGetUserScreens");
            IEnumerable <UserMenu> userMenu = userMenuDataSet.Tables[0].AsEnumerable().GroupJoin(userMenuDataSet.Tables[1].AsEnumerable(), a => a.Field <string>("ControllerName"),
                                                                                                 b => b.Field <string>("ControllerName"), (a, b) => new UserMenu
            {
                GroupMenuTitle = a.Field <string>("GroupMenuTitle"),
                Links          = b.Select(links => new UserScreenLink
                {
                    ActionLinkText = links.Field <string>("ActionLinkText"),
                    ActionName     = links.Field <string>("ActionName"),
                    AreaName       = links.Field <string>("AreaName"),
                    ControllerName = links.Field <string>("ControllerName").Replace("Controller", string.Empty),
                    LinkIcon       = links.Field <string>("linkIcon"),
                    LinkOrderId    = links.Field <int?>("linkOrderId"),
                    ScreenID       = links.Field <int>("screenId")
                }).ToList()
            });

            return(userMenu);
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Get the available budget category
 /// </summary>
 /// <returns>Return busdget category result set</returns>
 public DataSet GetAvailableBudgetCategory()
 {
     object[] objBudgetCategory = new object[1];
     objBudgetCategory[0] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objBudgetCategory, "bspGetAvailableBudgetCategory"));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Get all my transactions.
 /// </summary>
 /// <returns>Transaction result set.</returns>
 public DataSet GetAllMyTransactions()
 {
     object[] transactionInput = new object[1];
     transactionInput[0] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref transactionInput, "bspGetAllMyTransactions"));
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Get look ups for transaction analysis.
 /// </summary>
 /// <returns></returns>
 public DataSet GetAnalysisLookUps()
 {
     object[] objAnalysisLookUpParams = new object[2];
     objAnalysisLookUpParams[0] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objAnalysisLookUpParams, "bspGetAnalysisLookUps"));
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Get dashboard data
 /// </summary>
 /// <param name="userId">User Id</param>
 /// <returns><see cref="DataSet"/></returns>
 public DataSet GetDashboardData(string userId)
 {
     object[] objDashBoard = new object[] { userId, userSession.CompanyId };
     return(DataLibrary.ExecuteDataSet(ref objDashBoard, "bspGetDashboardBudgetSummary"));
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Get all my expenses.
 /// </summary>
 /// <returns>All the expenses associated to the company user belongs to.</returns>
 public DataSet GetAllMyExpenses()
 {
     object[] expenseDetails = new object[1];
     expenseDetails[0] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref expenseDetails, "bspGetAllMyExpenses"));
 }