public List <YF_AssetMainRecordModel> GetYF_AssetMainRecordList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, int FKCodeEqual, string ContentEqual, int CostTimeEqual, decimal CostMoneyEqual, string ChangeDetailEqual, string UserSignEqual, string MainUserEqual, DateTime MainTimeEqual, string ResultEqual) { List <YF_AssetMainRecordModel> models = new List <YF_AssetMainRecordModel>(); YF_AssetMainRecordQueryModel objQueryModel = new YF_AssetMainRecordQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.FKCodeEqual = FKCodeEqual; objQueryModel.ContentEqual = ContentEqual; objQueryModel.CostTimeEqual = CostTimeEqual; objQueryModel.CostMoneyEqual = CostMoneyEqual; objQueryModel.ChangeDetailEqual = ChangeDetailEqual; objQueryModel.UserSignEqual = UserSignEqual; objQueryModel.MainUserEqual = MainUserEqual; objQueryModel.MainTimeEqual = MainTimeEqual; objQueryModel.ResultEqual = ResultEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new YF_AssetMainRecordBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <YF_AssetMainRecordModel> _Select(YF_AssetMainRecordQueryModel qmObj) { List <YF_AssetMainRecordModel> list = new List <YF_AssetMainRecordModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from YF_AssetMainRecord "); builder.Append(qmObj.QueryConditionStr); if (qmObj.SortColumns.Length == 0) { builder.Append(" ORDER BY Code 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))) { YF_AssetMainRecordModel model = new YF_AssetMainRecordModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public string GetMainRecordCodeByMainCode(string incode) { string text = null; int result; if (int.TryParse(incode, out result)) { YF_AssetMainRecordBFL dbfl = new YF_AssetMainRecordBFL(); YF_AssetMainRecordQueryModel queryModel = new YF_AssetMainRecordQueryModel(); List <YF_AssetMainRecordModel> list = new List <YF_AssetMainRecordModel>(); queryModel.FKCodeEqual = result; list = dbfl.GetYF_AssetMainRecordList(queryModel); if (list.Count > 0) { text = list[0].Code.ToString(); } } return(text); }
public List <YF_AssetMainRecordModel> GetYF_AssetMainRecordList(YF_AssetMainRecordQueryModel QueryModel) { List <YF_AssetMainRecordModel> models = new List <YF_AssetMainRecordModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new YF_AssetMainRecordQueryModel(); } models = new YF_AssetMainRecordBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <YF_AssetMainRecordModel> GetYF_AssetMainRecordList(string SortColumns, int StartRecord, int MaxRecords, string CodeEqual, string FKCodeEqual, string ContentEqual, string CostTimeEqual, string CostMoneyEqual, string ChangeDetailEqual, string UserSignEqual, string MainUserEqual, string MainTimeEqual, string ResultEqual) { List <YF_AssetMainRecordModel> models = new List <YF_AssetMainRecordModel>(); YF_AssetMainRecordQueryModel objQueryModel = new YF_AssetMainRecordQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; if (!string.IsNullOrEmpty(CodeEqual)) { objQueryModel.CodeEqual = int.Parse(CodeEqual); } if (!string.IsNullOrEmpty(FKCodeEqual)) { objQueryModel.FKCodeEqual = int.Parse(FKCodeEqual); } if (!string.IsNullOrEmpty(ContentEqual)) { objQueryModel.ContentEqual = ContentEqual; } if (!string.IsNullOrEmpty(CostTimeEqual)) { objQueryModel.CostTimeEqual = int.Parse(CostTimeEqual); } if (!string.IsNullOrEmpty(CostMoneyEqual)) { objQueryModel.CostMoneyEqual = decimal.Parse(CostMoneyEqual); } if (!string.IsNullOrEmpty(ChangeDetailEqual)) { objQueryModel.ChangeDetailEqual = ChangeDetailEqual; } if (!string.IsNullOrEmpty(UserSignEqual)) { objQueryModel.UserSignEqual = UserSignEqual; } if (!string.IsNullOrEmpty(MainUserEqual)) { objQueryModel.MainUserEqual = MainUserEqual; } if (!string.IsNullOrEmpty(MainTimeEqual)) { objQueryModel.MainTimeEqual = DateTime.Parse(MainTimeEqual); } if (!string.IsNullOrEmpty(ResultEqual)) { objQueryModel.ResultEqual = ResultEqual; } using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { try { connection.Open(); models = new YF_AssetMainRecordBLL().GetModels(objQueryModel, connection); } catch (SqlException exception) { throw exception; } return(models); } finally { connection.Close(); } } return(models); }
public List <YF_AssetMainRecordModel> GetModels(YF_AssetMainRecordQueryModel ObjQueryModel, SqlTransaction Transaction) { YF_AssetMainRecordDAL ddal = new YF_AssetMainRecordDAL(Transaction); return(ddal.Select(ObjQueryModel)); }
public List <YF_AssetMainRecordModel> Select(YF_AssetMainRecordQueryModel qmObj) { return(this._Select(qmObj)); }
public List <YF_AssetMainRecordModel> Select() { YF_AssetMainRecordQueryModel qmObj = new YF_AssetMainRecordQueryModel(); return(this._Select(qmObj)); }