Ejemplo n.º 1
0
 public int DeleteCustomModel(CustomsModel model)
 {
     using (Entities db = new Entities())
     {
         map_customs entity = db.map_customs.FirstOrDefault(a => a.id == model.id);
         if (model != null)
         {
             db.map_customs.Remove(entity);
         }
         return(db.SaveChanges());
     }
 }
Ejemplo n.º 2
0
        public map_customs AddCustoms(CustomsModel model)
        {
            using (Entities db = new Entities())
            {
                map_customs cmmodel = new map_customs();

                cmmodel.x          = model.x;
                cmmodel.y          = model.y;
                cmmodel.userid     = model.userid;
                cmmodel.remark     = model.remark;
                cmmodel.createtime = DateTime.Now;
                db.map_customs.Add(cmmodel);
                db.SaveChanges();
                return(cmmodel);
            }
        }
Ejemplo n.º 3
0
        public CustomsModel GetCustomModel(int id)
        {
            CustomsModel model = new CustomsModel();

            using (Entities db = new Entities())
            {
                IQueryable <CustomsModel> queryable = from a in db.map_customs
                                                      select new CustomsModel
                {
                    id         = a.id,
                    x          = a.x,
                    y          = a.y,
                    userid     = a.userid,
                    remark     = a.remark,
                    createtime = a.createtime,
                };
                model = queryable.FirstOrDefault(a => a.id == id);
            }
            return(model);
        }
Ejemplo n.º 4
0
 public int DeleteCustomModel(CustomsModel model)
 {
     return(bll.DeleteCustomModel(model));
 }
Ejemplo n.º 5
0
 public map_customs AddCustoms(CustomsModel model)
 {
     return(bll.AddCustoms(model));
 }