public int Delete(int Code, SqlTransaction Transaction) { LocaleViseDAL edal = new LocaleViseDAL(Transaction); LocaleViseCostDAL tdal = new LocaleViseCostDAL(Transaction); LocaleViseCostQueryModel qmObj = new LocaleViseCostQueryModel(); qmObj.ViseCode = Code; foreach (LocaleViseCostModel model2 in tdal.Select(qmObj)) { tdal.Delete(model2.ViseCostCode); } return(edal.Delete(Code)); }
public decimal GetViseSumMoney(int ViseCode, SqlTransaction Transaction) { decimal num = 0M; LocaleViseCostQueryModel viseCostQueryModel = new LocaleViseCostQueryModel(); viseCostQueryModel.ViseCode = ViseCode; List <LocaleViseCostModel> list = this.SelectCost(viseCostQueryModel, Transaction); foreach (LocaleViseCostModel model2 in list) { num += model2.Money; } return(num); }
private List <LocaleViseCostModel> _Select(LocaleViseCostQueryModel qmObj) { List <LocaleViseCostModel> list = new List <LocaleViseCostModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from LocaleViseCost "); builder.Append(qmObj.QueryConditionStr); if (qmObj.SortColumns.Length == 0) { builder.Append(" ORDER BY ViseCostCode desc"); } else { builder.Append(" ORDER BY " + qmObj.SortColumns); } this._DataProcess.CommandText = builder.ToString(); this._DataProcess.SqlParameters = qmObj.Parameters; SqlDataReader sqlDataReader = null; int num = 0; try { try { sqlDataReader = this._DataProcess.GetSqlDataReader(); while (sqlDataReader.Read()) { if ((num >= qmObj.StartRecord) && ((list.Count < qmObj.MaxRecords) || (qmObj.MaxRecords == -1))) { LocaleViseCostModel model = new LocaleViseCostModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public List <LocaleViseCostModel> GetLocalViseCosts(int Code) { List <LocaleViseCostModel> list = new List <LocaleViseCostModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { LocaleViseCostQueryModel viseCostQueryModel = new LocaleViseCostQueryModel(); viseCostQueryModel.ViseCode = Code; list = new LocaleViseBLL().SelectCost(viseCostQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <LocaleViseCostModel> SelectCost(LocaleViseCostQueryModel ViseCostQueryModel, SqlTransaction Transaction) { LocaleViseCostDAL tdal = new LocaleViseCostDAL(Transaction); return(tdal.Select(ViseCostQueryModel)); }
public List <LocaleViseCostModel> Select(LocaleViseCostQueryModel qmObj) { return(this._Select(qmObj)); }
public List <LocaleViseCostModel> Select() { LocaleViseCostQueryModel qmObj = new LocaleViseCostQueryModel(); return(this._Select(qmObj)); }