public int Delete(TCheckPaymentSumModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new TCheckPaymentSumBLL().Delete(ObjModel.Code, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public List <TCheckPaymentSumModel> GetTCheckPaymentSumList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string SendUnitEqual, DateTime SumDateEqual, string AuditingEqual) { List <TCheckPaymentSumModel> models = new List <TCheckPaymentSumModel>(); TCheckPaymentSumQueryModel objQueryModel = new TCheckPaymentSumQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.SendUnitEqual = SendUnitEqual; objQueryModel.SumDateEqual = SumDateEqual; objQueryModel.AuditingEqual = AuditingEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { models = new TCheckPaymentSumBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public TCheckPaymentSumModel GetTCheckPaymentSum(int Code) { TCheckPaymentSumModel model = new TCheckPaymentSumModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); model = new TCheckPaymentSumBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <TCheckPaymentSumModel> GetTCheckPaymentSumListOne(int Code) { List <TCheckPaymentSumModel> list = new List <TCheckPaymentSumModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); TCheckPaymentSumBLL mbll = new TCheckPaymentSumBLL(); list.Add(mbll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <TCheckPaymentSumModel> GetTCheckPaymentSumList(TCheckPaymentSumQueryModel QueryModel) { List <TCheckPaymentSumModel> models = new List <TCheckPaymentSumModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new TCheckPaymentSumQueryModel(); } models = new TCheckPaymentSumBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }