Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        public QccustomerlibraryModelList GetModelList(QccustomerlibraryModel model)
        {
            QccustomerlibraryTable table = new QccustomerlibraryTable();
            QcmaininfoTable        main  = new QcmaininfoTable();
            SelectSqlSection       sql   = DataAccess.DefaultDB.Select(table, table.AllColumns(), main.Status);

            sql.Join(main, table.QualityCode == main.QualityCode);
            if (model.QualityCode != "")
            {
                sql.Where(table.QualityCode == model.QualityCode);
            }

            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QccustomerlibraryModelList result = new QccustomerlibraryModelList();
                while (sdr.Read())
                {
                    QccustomerlibraryModel m = new QccustomerlibraryModel();
                    m.Status            = sdr.GetString(main.Status);
                    m.QualityCode       = sdr.GetString(table.QualityCode);
                    m.BuyerId           = sdr.GetString(table.BuyerId);
                    m.Brand             = sdr.GetString(table.Brand);
                    m.CustomerQualityId = sdr.GetString(table.CustomerQualityId);
                    m.Sales             = sdr.GetString(table.Sales);
                    m.SalesGroup        = sdr.GetString(table.SalesGroup);
                    m.MillComments      = sdr.GetString(table.MillComments);
                    m.IsFirstOwner      = sdr.GetString(table.IsFirstOwner);
                    m.CreateDate        = sdr.GetDateTime(table.CreateDate);
                    m.Creator           = sdr.GetString(table.Creator);
                    result.Add(m);
                }
                return(result);
            }
        }
Exemplo n.º 4
0
        public QC_HF_ChangeLogModelList GetModelList(string qualityCode)
        {
            QC_HF_ChangeLogTable table = new QC_HF_ChangeLogTable();
            SelectSqlSection     sql   = DataAccess.DefaultDB.Select(table, table.AllColumns());

            if (qualityCode != "")
            {
                sql.Where(table.QUALITY_CODE == qualityCode);
            }
            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QC_HF_ChangeLogModelList result = new QC_HF_ChangeLogModelList();
                while (sdr.Read())
                {
                    QC_HF_ChangeLogModel m = new QC_HF_ChangeLogModel();
                    m.QualityCode    = sdr.GetString(table.QUALITY_CODE);
                    m.QC_Ref_PPO_Old = sdr.GetString(table.QC_Ref_PPO_Old);
                    m.QC_Ref_GP_Old  = sdr.GetString(table.QC_Ref_GP_Old);
                    m.HF_Ref_PPO_Old = sdr.GetString(table.HF_Ref_PPO_Old);
                    m.HF_Ref_GP_Old  = sdr.GetString(table.HF_Ref_GP_Old);
                    m.QC_Ref_PPO_New = sdr.GetString(table.QC_Ref_PPO_New);
                    m.QC_Ref_GP_New  = sdr.GetString(table.QC_Ref_GP_New);
                    m.HF_Ref_PPO_New = sdr.GetString(table.HF_Ref_PPO_New);
                    m.HF_Ref_GP_New  = sdr.GetString(table.HF_Ref_GP_New);
                    m.CreateDate     = sdr.GetDateTime(table.CREATE_DATE);
                    m.Creator        = sdr.GetString(table.CREATOR);

                    result.Add(m);
                }
                return(result);
            }
        }
Exemplo n.º 5
0
        public QcyarndtlModelList GetModelList(QcyarndtlModel model)
        {
            QcyarndtlTable   table = new QcyarndtlTable();
            SelectSqlSection sql   = DataAccess.DefaultDB.Select(table, table.AllColumns());

            if (model.QualityCode != "")
            {
                sql.Where(table.QualityCode == model.QualityCode);
            }
            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QcyarndtlModelList result = new QcyarndtlModelList();
                while (sdr.Read())
                {
                    QcyarndtlModel m = new QcyarndtlModel();
                    m.Iden          = sdr.GetInt32(table.Iden);
                    m.QualityCode   = sdr.GetString(table.QualityCode);
                    m.YarnType      = sdr.GetString(table.YarnType);
                    m.YarnCount     = sdr.GetString(table.YarnCount);
                    m.Threads       = sdr.GetInt32(table.Threads);
                    m.YarnRatio     = sdr.GetDecimal(table.YarnRatio);
                    m.YarnComponent = sdr.GetString(table.YarnComponent);
                    m.WarpWeft      = sdr.GetString(table.WarpWeft);
                    m.YarnDensity   = sdr.GetInt32(table.YarnDensity);
                    result.Add(m);
                }
                return(result);
            }
        }
Exemplo n.º 6
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);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 获取总记录条数
        /// </summary>
        /// <param name="column">主键</param>
        /// <returns></returns>
        public static int GetTotalRecord(EDatabase db, IQueryTable table, WhereClip where, List <JoinTable> joinTables)
        {
            SelectSqlSection sql = db.Select(table, table.IDColumn.Count());

            if (joinTables != null && joinTables.Count > 0)
            {
                foreach (JoinTable joinTable in joinTables)
                {
                    joinTable.Join(sql);
                }
            }
            object obj = sql.Where(where).ToScalar();

            if (obj != null)
            {
                return(Convert.ToInt32(obj));
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 8
0
        public QcconstructiondtlModelList GetModelList(QcconstructiondtlModel model)
        {
            QcconstructiondtlTable table = new QcconstructiondtlTable();
            SelectSqlSection       sql   = DataAccess.DefaultDB.Select(table, table.AllColumns());

            if (model.QualityCode != "")
            {
                sql.Where(table.QualityCode == model.QualityCode);
            }
            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QcconstructiondtlModelList result = new QcconstructiondtlModelList();
                while (sdr.Read())
                {
                    QcconstructiondtlModel m = new QcconstructiondtlModel();
                    m.Iden         = sdr.GetInt32(table.Iden);
                    m.QualityCode  = sdr.GetString(table.QualityCode);
                    m.Construction = sdr.GetString(table.Construction);
                    result.Add(m);
                }
                return(result);
            }
        }