Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public void InitFinish(DataTable dt)
 {
     qcFinishList = new QcfinishdtlModelList();
     if (dt.Rows.Count == 0)
     {
         return;
     }
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         QcfinishdtlModel cm = new QcfinishdtlModel();
         cm.FinishingCode = dt.Rows[i]["Finishing_Code"].ToString();
         cm.Description   = dt.Rows[i]["Finishing_Name"].ToString();
         qcFinishList.Add(cm);
     }
 }
Esempio n. 3
0
        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);
            }
        }