/// <summary> /// Create USer Group /// </summary> /// <param name="userId">User Id</param> /// <param name="groupName">Group Name</param> public void CreateUserGroup(string userId, string groupName) { object[] objCreateGroup = new object[2]; objCreateGroup[0] = userId; objCreateGroup[1] = groupName; DataLibrary.ExecuteQuery(ref objCreateGroup, "bspAddApplicationUserGroup"); }
/// <summary> /// To add the Budget category to the application /// </summary> /// <returns>True if success else false</returns> public bool AddBudgetCategory(string categoryName, string createdBy) { object[] objAddBudgetCategoryParameters = new object[3]; objAddBudgetCategoryParameters[0] = categoryName; objAddBudgetCategoryParameters[1] = createdBy; objAddBudgetCategoryParameters[2] = userSession.CompanyId; return(DataLibrary.ExecuteQuery(ref objAddBudgetCategoryParameters, "bspCreateBudgetCategory") == -1 ? true : false); }
/// <summary> /// Delete selected component record /// </summary> /// <param name="recordId">Record Unique ID</param> /// <param name="componentType">Component Type</param> public void deleteSelectedComponentRecord(string recordId, char componentType) { object[] objComponentParameters = new object[3]; objComponentParameters[0] = recordId; objComponentParameters[1] = componentType; objComponentParameters[2] = userSession.CompanyId; DataLibrary.ExecuteQuery(ref objComponentParameters, "bspDeleteRecordOfSelectedComponent"); }
/// <summary> /// Accept Invitation /// </summary> /// <param name="companyId">Company Id to join</param> /// <param name="invitationType">Invitation type to process</param> public void AcceptInvitation(string userId, long?companyId, string invitationType) { object[] objFriendInvitation = new object[3]; objFriendInvitation[0] = companyId; objFriendInvitation[1] = userId; objFriendInvitation[2] = invitationType; DataLibrary.ExecuteQuery(ref objFriendInvitation, "bspAcceptInvitation"); }
/// <summary> /// To add the user group to the application /// </summary> /// <returns>True if success else false</returns> public bool AddUserGroup(string userId, string groupName, string selectedUsers) { object[] objAddUserGroup = new object[4]; objAddUserGroup[0] = userId; objAddUserGroup[1] = groupName; objAddUserGroup[2] = selectedUsers; objAddUserGroup[3] = userSession.CompanyId; return(DataLibrary.ExecuteQuery(ref objAddUserGroup, "bspCreateUserGroup") > 0 ? true : false); }
/// <summary> /// Update the user permission for the selected screen /// </summary> /// <param name="screenId">Screen Id</param> /// <param name="actionType">Action Type (R-Read, W-Write, D-Delete)</param> /// <param name="isPermitted">Is allowed</param> public void UpdateScreenPermission(int screenId, char actionType, int isPermitted, string userId) { object[] objUserPermission = new object[5]; objUserPermission[0] = screenId; objUserPermission[1] = actionType; objUserPermission[2] = isPermitted; objUserPermission[3] = userId; objUserPermission[4] = userSession.CompanyId; DataLibrary.ExecuteQuery(ref objUserPermission, "bspUpdateUserPermission"); }
/// <summary> /// Updates the screen data /// </summary> /// <param name="userId">User Id</param> /// <param name="screenId">Screen Id</param> /// <param name="screenParameter">Screen Parameter</param> public void UpdateScreenData(string userId, int screenId, string screenParameter, char type) { object[] objScreenParameter = new object[5]; objScreenParameter[0] = userId; objScreenParameter[1] = userSession.CompanyId; objScreenParameter[2] = screenId; objScreenParameter[3] = screenParameter; objScreenParameter[4] = type; DataLibrary.ExecuteQuery(ref objScreenParameter, "bspUpdateScreenData"); }
/// <summary> /// Create new transaction for the expense. /// </summary> /// <param name="transactionData">transaction data</param> /// <returns>true if transaction saved successfully else false.</returns> public bool CreateTransaction(TransactionMembers transactionData) { object[] transactionInputData = new object[7]; transactionInputData[0] = transactionData.ExpenseId; transactionInputData[1] = transactionData.AmountReturned; transactionInputData[2] = transactionData.AmountReturnedOn; transactionInputData[3] = transactionData.ReturnedBy; transactionInputData[4] = transactionData.ReceivedBy; transactionInputData[5] = transactionData.Description; transactionInputData[6] = userSession.CompanyId; return(DataLibrary.ExecuteQuery(ref transactionInputData, "bspCreateTransaction").Equals(0)); }
/// <summary> /// Add the application screens /// </summary> public void AddApplicationScreens(SharedAssembly.ScreenRoute screens) { object[] objAppScreens = new object[8]; objAppScreens[0] = screens.ActionName; objAppScreens[1] = screens.ControllerName; objAppScreens[2] = screens.AreaName; objAppScreens[3] = screens.LinkText; objAppScreens[4] = screens.GroupMenuTitle; objAppScreens[5] = screens.Read; objAppScreens[6] = screens.Write; objAppScreens[7] = screens.Delete; DataLibrary.ExecuteQuery(ref objAppScreens, "bspAddApplicationScreens"); }
/// <summary> /// Update Selected Component Record /// </summary> /// <param name="updateParameter">Update Parameter</param> /// <param name="componentType">Component Type</param> /// <param name="parameterCount">Parameter Count</param> public void UpdateSelectedComponentRecord(Dictionary <string, object> updateParameter, int parameterCount, string procedureName) { object[] objComponentParameters = new object[parameterCount]; int loopCount = 0; foreach (var paramValue in updateParameter.Values) { objComponentParameters[loopCount] = GetEncodedValueOnString(paramValue); loopCount++; } DataLibrary.ExecuteQuery(ref objComponentParameters, procedureName); }
/// <summary> /// To add the Budget to the application /// </summary> /// <returns>True if success else false</returns> public bool AddBudget(BudgetDetails createBudgetData) { object[] objAddBudgetParameters = new object[9]; objAddBudgetParameters[0] = createBudgetData.BudgetName; objAddBudgetParameters[1] = createBudgetData.BudgetDescription; objAddBudgetParameters[2] = createBudgetData.MinimumAmount; objAddBudgetParameters[3] = createBudgetData.MaximumAmount; objAddBudgetParameters[4] = createBudgetData.StartDate; objAddBudgetParameters[5] = createBudgetData.EndDate; objAddBudgetParameters[6] = createBudgetData.CreatedBy; objAddBudgetParameters[7] = createBudgetData.Category; objAddBudgetParameters[8] = userSession.CompanyId; return(DataLibrary.ExecuteQuery(ref objAddBudgetParameters, "bspCreateBudget") == -1 ? true : false); }
/// <summary> /// Log Invitation /// </summary> /// <param name="invitedUserID">Invited User Id</param> /// <param name="invitedBy">Invited By</param> /// <param name="invitedCompanyId">Invited User Company Id</param> /// <returns>True if success else false</returns> public bool LogInvitation(string invitedUserID, string invitedBy, string invitedCompanyId) { bool isLogged = true; object[] objLogInvitation = new object[4]; objLogInvitation[0] = invitedUserID; objLogInvitation[1] = invitedBy; objLogInvitation[2] = invitedCompanyId; objLogInvitation[3] = userSession.CompanyId; try { DataLibrary.ExecuteQuery(ref objLogInvitation, "bspLogInvitation"); } catch (Exception ex) { isLogged = false; throw ex; } return(isLogged); }
/// <summary> /// Update account settings data. /// </summary> /// <param name="userInformation">User information</param> /// <returns></returns> public bool UpdateAccountSettingsData(UserInformation userInformation) { object[] userInformationObject = userInformation.BindModelToDBObject <UserInformation>(); return(DataLibrary.ExecuteQuery(ref userInformationObject, "bspUpdateAccountSettingsData") <= 0); }