public void DeleteModel(PbknitfinishModel model) { PbknitfinishTable table = new PbknitfinishTable(); DataAccess.DefaultDB.Delete(table) .Execute(); }
public QcfinishdtlModelList GetModelList(QcfinishdtlModel model) { QcfinishdtlTable table = new QcfinishdtlTable(); PbknitfinishTable finishTable = new PbknitfinishTable(); SelectSqlSection sql = DataAccess.DefaultDB.Select(table, table.AllColumns(), finishTable.FinishingName); sql.Join(finishTable, table.FinishingCode == finishTable.FinishingCode); if (model.QualityCode != "") { sql.Where(table.QualityCode == model.QualityCode); } using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader())) { QcfinishdtlModelList result = new QcfinishdtlModelList(); while (sdr.Read()) { QcfinishdtlModel m = new QcfinishdtlModel(); m.Iden = sdr.GetInt32(table.Iden); m.Description = sdr.GetString(finishTable.FinishingName); m.QualityCode = sdr.GetString(table.QualityCode); m.FinishingCode = sdr.GetString(table.FinishingCode); result.Add(m); } return(result); } }
protected bool Exists(PbknitfinishModel model, bool isNew) { PbknitfinishTable table = new PbknitfinishTable(); SelectSqlSection sql = DataAccess.DefaultDB.Select(table, QueryColumn.All().Count()) .Where(table.FinishingCode == model.FinishingCode && table.FinishingName == model.FinishingName && table.Description == model.Description && table.WashingFlag == model.WashingFlag && table.IsActive == model.IsActive ); return(sql.ToScalar <int>() > 0); }
public void UpdateModel(PbknitfinishModel model) { //model.UpdateTime = System.DateTime.Now; PbknitfinishTable table = new PbknitfinishTable(); DataAccess.DefaultDB.Update(table) .AddColumn(table.FinishingCode, model.FinishingCode) .AddColumn(table.FinishingName, model.FinishingName) .AddColumn(table.Description, model.Description) .AddColumn(table.WashingFlag, model.WashingFlag) .AddColumn(table.IsActive, model.IsActive) .Execute(); }
public PbknitfinishModelList GetModelList(PbknitfinishModel model) { PbknitfinishTable table = new PbknitfinishTable(); SelectSqlSection sql = DataAccess.DefaultDB.Select(table, table.AllColumns()) ; using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader())) { PbknitfinishModelList result = new PbknitfinishModelList(); while (sdr.Read()) { PbknitfinishModel m = new PbknitfinishModel(); m.FinishingCode = sdr.GetString(table.FinishingCode); m.FinishingName = sdr.GetString(table.FinishingName); m.Description = sdr.GetString(table.Description); m.WashingFlag = sdr.GetString(table.WashingFlag); m.IsActive = sdr.GetString(table.IsActive); result.Add(m); } return(result); } }
public QcfinishdtlModelList GetModelListOne(QcfinishdtlModel model) { QcfinishdtlTable table = new QcfinishdtlTable(); PbknitfinishTable table1 = new PbknitfinishTable(); SelectSqlSection sql = DataAccess.DefaultDB.Select(table1, table1.FinishingName).Join(table, table.FinishingCode == table1.FinishingCode); if (model.QualityCode != "") { sql.Where(table.QualityCode == model.QualityCode); } using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader())) { QcfinishdtlModelList result = new QcfinishdtlModelList(); while (sdr.Read()) { QcfinishdtlModel m = new QcfinishdtlModel(); m.FinishingCode = sdr.GetString(table1.FinishingName); result.Add(m); } return(result); } }