public string[] UpdateDataAccessLevels_MultiPageDataAccessLevelsPage(string state, string DataAccessLevelKey, string AccessLevelOperationType, string UserID, string SearchKey, string SearchTerm, string DataAccessLevelSourceID, string DataAccessLevelTargetID) { this.InitializeCulture(); string[] retMessage = new string[4]; state = this.StringBuilder.CreateString(state); DataAccessLevelOperationType dataAccessLevelOperationType = (DataAccessLevelOperationType)Enum.Parse(typeof(DataAccessLevelOperationType), this.StringBuilder.CreateString(AccessLevelOperationType)); decimal userID = decimal.Parse(this.StringBuilder.CreateString(UserID)); SearchKey = this.StringBuilder.CreateString(SearchKey); UserSearchKeys?searchKey = SearchKey != "Null" ? (UserSearchKeys)Enum.Parse(typeof(UserSearchKeys), SearchKey) : (UserSearchKeys?)null; SearchTerm = this.StringBuilder.CreateString(SearchTerm); DataAccessParts dataAccessLevelKey = (DataAccessParts)Enum.Parse(typeof(DataAccessParts), this.StringBuilder.CreateString(DataAccessLevelKey)); decimal dataAccessLevelSourceID = decimal.Parse(this.StringBuilder.CreateString(DataAccessLevelSourceID)); decimal dataAccessLevelTargetID = decimal.Parse(this.StringBuilder.CreateString(DataAccessLevelTargetID)); UIActionType uam = UIActionType.ADD; try { switch (state) { case "Add": uam = UIActionType.ADD; if (dataAccessLevelSourceID == -1) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, new Exception(GetLocalResourceObject("NoDataAccessLevelSourceSelectedforInsert").ToString()), retMessage); return(retMessage); } this.MultiPageDataAccessLevelesBusiness.InsertDataAccess(dataAccessLevelOperationType, dataAccessLevelKey, dataAccessLevelSourceID, userID, searchKey, SearchTerm); break; case "Delete": uam = UIActionType.DELETE; if (dataAccessLevelTargetID == -1) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, new Exception(GetLocalResourceObject("NoDataAccessLevelTargetSelectedforDelete").ToString()), retMessage); return(retMessage); } this.MultiPageDataAccessLevelesBusiness.DeleteAccess(dataAccessLevelKey, dataAccessLevelTargetID, userID); break; default: break; } retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString(); string SuccessMessageBody = string.Empty; switch (uam) { case UIActionType.ADD: SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString(); break; case UIActionType.DELETE: SuccessMessageBody = GetLocalResourceObject("DeleteComplete").ToString(); break; } retMessage[1] = SuccessMessageBody; retMessage[2] = "success"; return(retMessage); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); return(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); return(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); return(retMessage); } }
private void Fill_GridDataAccessLevelsTarget_MultiPageDataAccessLevels(decimal UserID, DataAccessParts DataAccessLevelKey, DataAccessLevelOperationType Dalot, LoadState Ls, int pageSize, int pageIndex, string SearchTerm, UserSearchKeys?UserSearchKey, string UserSearchTerm) { IList <DataAccessProxy> MultiPageDataAccessLevelesTargetList = null; UserID = this.GetUserID_MultiPageDataAccessLevels(Dalot, UserID, UserSearchKey, UserSearchTerm); switch (DataAccessLevelKey) { case DataAccessParts.Manager: switch (Ls) { case LoadState.Normal: SearchTerm = string.Empty; break; case LoadState.Search: break; } MultiPageDataAccessLevelesTargetList = this.MultiPageDataAccessLevelesBusiness.GetAllManagerOfUser(UserID, SearchTerm, pageIndex, pageSize); break; } if (MultiPageDataAccessLevelesTargetList != null && MultiPageDataAccessLevelesTargetList.Count == 1 && MultiPageDataAccessLevelesTargetList[0].All) { MultiPageDataAccessLevelesTargetList[0].Name = GetLocalResourceObject("All").ToString() + " " + GetLocalResourceObject(DataAccessLevelKey.ToString()).ToString(); } this.GridDataAccessLevelsTarget_MultiPageDataAccessLevels.DataSource = MultiPageDataAccessLevelesTargetList; this.GridDataAccessLevelsTarget_MultiPageDataAccessLevels.DataBind(); }
private void Fill_GridDataAccessLevelsTarget_SinglePageDataAccessLevels(decimal UserID, DataAccessParts DataAccessLevelKey, DataAccessLevelOperationType Dalot, UserSearchKeys?SearchKey, string SearchTerm) { UserID = this.GetUserID_SinglePageDataAccessLevels(Dalot, UserID, SearchKey, SearchTerm); IList <DataAccessProxy> SinglePageDataAccessLevelesTargetList = this.SinglePageDataAccessLevelesBusiness.GetAllByUserId(DataAccessLevelKey, UserID); if (SinglePageDataAccessLevelesTargetList != null && SinglePageDataAccessLevelesTargetList.Count == 1 && SinglePageDataAccessLevelesTargetList[0].All) { SinglePageDataAccessLevelesTargetList[0].Name = GetLocalResourceObject("All").ToString() + " " + GetLocalResourceObject(DataAccessLevelKey.ToString()).ToString(); } this.GridDataAccessLevelsTarget_SinglePageDataAccessLevels.DataSource = SinglePageDataAccessLevelesTargetList; this.GridDataAccessLevelsTarget_SinglePageDataAccessLevels.DataBind(); }
private void Fill_GridDataAccessLevelsTarget_MultiPageDataAccessLevels(decimal UserID, DataAccessParts DataAccessLevelKey, DataAccessLevelOperationType Dalot, LoadState Ls, int pageSize, int pageIndex, string SearchTerm, DataAccessLevelOperationState Dalos, UserSearchKeys?UserSearchKey, string UserSearchTerm) { string[] retMessage = new string[4]; try { switch (Dalot) { case DataAccessLevelOperationType.Single: this.Fill_GridDataAccessLevelsTarget_MultiPageDataAccessLevels(UserID, DataAccessLevelKey, Dalot, Ls, pageSize, pageIndex, SearchTerm, UserSearchKey, UserSearchTerm); break; case DataAccessLevelOperationType.Group: switch (Dalos) { case DataAccessLevelOperationState.Before: break; case DataAccessLevelOperationState.After: this.Fill_GridDataAccessLevelsTarget_MultiPageDataAccessLevels(UserID, DataAccessLevelKey, Dalot, Ls, pageSize, pageIndex, SearchTerm, UserSearchKey, UserSearchTerm); break; } break; default: this.Fill_GridDataAccessLevelsTarget_MultiPageDataAccessLevels(UserID, DataAccessLevelKey, Dalot, Ls, pageSize, pageIndex, SearchTerm, UserSearchKey, UserSearchTerm); break; } } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_DataAccessLevelsTarget.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_DataAccessLevelsTarget.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_DataAccessLevelsTarget.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }
private void Fill_trvDataAccessLevelsTarget_MultiLevelsDataAccessLevels(decimal UserID, DataAccessParts DataAccessLevelKey, DataAccessLevelOperationType Dalot, DataAccessLevelOperationState Dalos, UserSearchKeys?SearchKey, string SearchTerm) { string[] retMessage = new string[4]; try { this.GetDataAccessLevelsRoot_MultiLevelsDataAccessLevels(trvDataAccessLevelsTarget_MultiLevelsDataAccessLevels, DataAccessLevelsType.Target, DataAccessLevelKey, Dalot, Dalos, UserID, SearchKey, SearchTerm); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_DataAccessLevelsTarget.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_DataAccessLevelsTarget.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_DataAccessLevelsTarget.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }