public List <CachetManageModel> GetCachetManageList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string UserNameEqual, string DeptEqual, string CachetNameEqual, DateTime StartDataEqual, DateTime EndDataEqual, string StateEqual, string TypeEqual) { List <CachetManageModel> models = new List <CachetManageModel>(); CachetManageQueryModel objQueryModel = new CachetManageQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.UserNameEqual = UserNameEqual; objQueryModel.DeptEqual = DeptEqual; objQueryModel.CachetNameEqual = CachetNameEqual; objQueryModel.StartDataEqual = StartDataEqual; objQueryModel.EndDataEqual = EndDataEqual; objQueryModel.StateEqual = StateEqual; objQueryModel.TypeEqual = TypeEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { models = new CachetManageBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public int Update(CachetManageModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new CachetManageBLL().Update(ObjModel, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public CachetManageModel GetCachetManage(int Code) { CachetManageModel model = new CachetManageModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { model = new CachetManageBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <CachetManageModel> GetCachetManageListOne(int Code) { List <CachetManageModel> list = new List <CachetManageModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { CachetManageBLL ebll = new CachetManageBLL(); list.Add(ebll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <CachetManageModel> GetCachetManageList(CachetManageQueryModel QueryModel) { List <CachetManageModel> models = new List <CachetManageModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new CachetManageQueryModel(); } models = new CachetManageBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }