public QcavailablewidthModelList GetModelList(QcavailablewidthModel model)
        {
            QcavailablewidthTable table = new QcavailablewidthTable();
            SelectSqlSection      sql   = DataAccess.DefaultDB.Select(table, table.AllColumns());

            if (model.QualityCode != "")
            {
                sql.Where(table.QualityCode == model.QualityCode);
            }
            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QcavailablewidthModelList result = new QcavailablewidthModelList();
                while (sdr.Read())
                {
                    QcavailablewidthModel m = new QcavailablewidthModel();
                    m.Iden         = sdr.GetInt32(table.Iden);
                    m.QualityCode  = sdr.GetString(table.QualityCode);
                    m.Gauge        = sdr.GetInt32(table.Gauge);
                    m.Diameter     = sdr.GetInt32(table.Diameter);
                    m.TotalNeedles = sdr.GetInt32(table.TotalNeedles);
                    m.Width        = sdr.GetInt32(table.Width);
                    m.MaxWidth     = sdr.GetInt32(table.MaxWidth);
                    m.UpdatedBy    = sdr.GetString(table.UpdatedBy);
                    m.UpdatedTime  = sdr.GetDateTime(table.UpdatedTime);
                    result.Add(m);
                }
                return(result);
            }
        }
Beispiel #2
0
        private QcavailablewidthModelList CreateAvaWidth(List <AvaWidthModel> listAWM)
        {
            QcavailablewidthModelList qcAvaWidthList = new QcavailablewidthModelList();

            for (int i = 0; i < listAWM.Count; i++)
            {
                QcavailablewidthModel qcAvaModel = new QcavailablewidthModel();
                qcAvaModel.Gauge        = listAWM[i].Gauge;
                qcAvaModel.Diameter     = listAWM[i].Diameter;
                qcAvaModel.QualityCode  = tQC.Text;
                qcAvaModel.TotalNeedles = listAWM[i].TotalNeedles;
                qcAvaModel.MaxWidth     = listAWM[i].MaxWidth;
                qcAvaModel.Width        = listAWM[i].Width;
                qcAvaModel.UpdatedBy    = HttpContext.Current.Session["UserId"].ToString();
                qcAvaModel.UpdatedTime  = System.DateTime.Now;
                qcAvaWidthList.Add(qcAvaModel);
            }
            return(qcAvaWidthList);
        }