public List <UserHelpGroupModel> GetUserHelpGroupList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string GroupNameEqual, string UserCodeEqual, DateTime CreateTimeEqual) { List <UserHelpGroupModel> models = new List <UserHelpGroupModel>(); UserHelpGroupQueryModel objQueryModel = new UserHelpGroupQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.GroupNameEqual = GroupNameEqual; objQueryModel.UserCodeEqual = UserCodeEqual; objQueryModel.CreateTimeEqual = CreateTimeEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { models = new UserHelpGroupBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public int Update(UserHelpGroupModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new UserHelpGroupBLL().Update(ObjModel, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public UserHelpGroupModel GetUserHelpGroup(int Code) { UserHelpGroupModel model = new UserHelpGroupModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { model = new UserHelpGroupBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <UserHelpGroupModel> GetUserHelpGroupListOne(int Code) { List <UserHelpGroupModel> list = new List <UserHelpGroupModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { UserHelpGroupBLL pbll = new UserHelpGroupBLL(); list.Add(pbll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <UserHelpGroupModel> GetUserHelpGroupList(UserHelpGroupQueryModel QueryModel) { List <UserHelpGroupModel> models = new List <UserHelpGroupModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new UserHelpGroupQueryModel(); } models = new UserHelpGroupBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }