Beispiel #1
0
        public void DeleteModel(PbknitconstructionModel model)
        {
            PbknitconstructionTable table = new PbknitconstructionTable();

            DataAccess.DefaultDB.Delete(table)
            .Execute();
        }
Beispiel #2
0
        protected bool Exists(PbknitconstructionModel model, bool isNew)
        {
            PbknitconstructionTable table = new PbknitconstructionTable();
            SelectSqlSection        sql   = DataAccess.DefaultDB.Select(table, QueryColumn.All().Count())
                                            .Where(table.Construction == model.Construction &&
                                                   table.Description == model.Description &&
                                                   table.DescriptionCn == model.DescriptionCn &&
                                                   table.SingleDouble == model.SingleDouble &&
                                                   table.IsSpecial == model.IsSpecial &&
                                                   table.IsActive == model.IsActive
                                                   );

            return(sql.ToScalar <int>() > 0);
        }
Beispiel #3
0
        public void UpdateModel(PbknitconstructionModel model)
        {
            //model.UpdateTime = System.DateTime.Now;
            PbknitconstructionTable table = new PbknitconstructionTable();

            DataAccess.DefaultDB.Update(table)
            .AddColumn(table.Construction, model.Construction)
            .AddColumn(table.Description, model.Description)
            .AddColumn(table.DescriptionCn, model.DescriptionCn)
            .AddColumn(table.SingleDouble, model.SingleDouble)
            .AddColumn(table.IsSpecial, model.IsSpecial)
            .AddColumn(table.IsActive, model.IsActive)
            .Execute();
        }
        public QcconstructiondtlModelList GetModelListOne(QcconstructiondtlModel model)
        {
            QcconstructiondtlTable  table  = new QcconstructiondtlTable();
            PbknitconstructionTable table1 = new PbknitconstructionTable();
            SelectSqlSection        sql    = DataAccess.DefaultDB.Select(table1, table1.Description).Join(table, table1.Construction == table.Construction);

            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.Construction = sdr.GetString(table1.Description);
                    result.Add(m);
                }
                return(result);
            }
        }
Beispiel #5
0
        public PbknitconstructionModelList GetModelList(PbknitconstructionModel model)
        {
            PbknitconstructionTable table = new PbknitconstructionTable();
            SelectSqlSection        sql   = DataAccess.DefaultDB.Select(table, table.AllColumns())
            ;

            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                PbknitconstructionModelList result = new PbknitconstructionModelList();
                while (sdr.Read())
                {
                    PbknitconstructionModel m = new PbknitconstructionModel();
                    m.Construction  = sdr.GetString(table.Construction);
                    m.Description   = sdr.GetString(table.Description);
                    m.DescriptionCn = sdr.GetString(table.DescriptionCn);
                    m.SingleDouble  = sdr.GetString(table.SingleDouble);
                    m.IsSpecial     = sdr.GetString(table.IsSpecial);
                    m.IsActive      = sdr.GetString(table.IsActive);
                    result.Add(m);
                }
                return(result);
            }
        }