Esempio n. 1
0
        public void DeleteModel(PbknityarncountModel model)
        {
            PbknityarncountTable table = new PbknityarncountTable();

            DataAccess.DefaultDB.Delete(table)
            .Execute();
        }
Esempio n. 2
0
        protected bool Exists(PbknityarncountModel model, bool isNew)
        {
            PbknityarncountTable table = new PbknityarncountTable();
            SelectSqlSection     sql   = DataAccess.DefaultDB.Select(table, QueryColumn.All().Count())
                                         .Where(table.YarnCount == model.YarnCount &&
                                                table.IsActive == model.IsActive
                                                );

            return(sql.ToScalar <int>() > 0);
        }
Esempio n. 3
0
        public void UpdateModel(PbknityarncountModel model)
        {
            //model.UpdateTime = System.DateTime.Now;
            PbknityarncountTable table = new PbknityarncountTable();

            DataAccess.DefaultDB.Update(table)
            .AddColumn(table.YarnCount, model.YarnCount)
            .AddColumn(table.IsActive, model.IsActive)
            .Execute();
        }
Esempio n. 4
0
        public PbknityarncountModelList GetModelList(PbknityarncountModel model)
        {
            PbknityarncountTable table = new PbknityarncountTable();
            SelectSqlSection     sql   = DataAccess.DefaultDB.Select(table, table.AllColumns())
            ;

            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                PbknityarncountModelList result = new PbknityarncountModelList();
                while (sdr.Read())
                {
                    PbknityarncountModel m = new PbknityarncountModel();
                    m.YarnCount = sdr.GetString(table.YarnCount);
                    m.IsActive  = sdr.GetString(table.IsActive);
                    result.Add(m);
                }
                return(result);
            }
        }