Example #1
0
        public int AddHawker(Zfdx_LawStreetStoreModel model)
        {
            using (Entities db = new Entities())
            {
                zfdx_streetshops shops = new zfdx_streetshops();
                shops.address      = model.address;
                shops.card         = model.card;
                shops.contactphone = model.contactphone;
                shops.createtime   = DateTime.Now;
                shops.createuserid = model.createuserid;
                shops.grometry     = model.grometry;
                shops.hawkertype   = model.hawkertype;
                shops.remark       = model.remark;
                shops.sourcearea   = model.sourcearea;
                shops.person       = model.person;
                shops.sstype       = 2;
                db.zfdx_streetshops.Add(shops);
                db.SaveChanges();

                //店铺-黑名单关系表
                zfdx_shopblacks shopblacks = new zfdx_shopblacks();
                shopblacks.shopid       = shops.zfdx_shopid;
                shopblacks.isblack      = 0; //是否黑名单(0否1是)
                shopblacks.createtime   = DateTime.Now;
                shopblacks.createuserid = shops.createuserid;
                shopblacks.reason       = "";
                db.zfdx_shopblacks.Add(shopblacks);
                return(db.SaveChanges());
            }
        }
Example #2
0
 public int RemoveStoreInBlackList(int zfdx_shopid)
 {
     using (Entities db = new Entities())
     {
         zfdx_shopblacks model = db.zfdx_shopblacks.FirstOrDefault(a => a.shopid == zfdx_shopid);
         if (model != null)
         {
             model.isblack = 0;  //是否黑名单(0否1是)
         }
         return(db.SaveChanges());
     }
 }
Example #3
0
 public int AddStoreInBlackList(int zfdx_shopid)
 {
     using (Entities db = new Entities())
     {
         zfdx_shopblacks model = db.zfdx_shopblacks.FirstOrDefault(a => a.shopid == zfdx_shopid);
         if (model != null)
         {
             model.isblack    = 1; //是否黑名单(0否1是)
             model.createtime = DateTime.Now;
         }
         return(db.SaveChanges());
     }
 }
Example #4
0
 public int DeleteStreetShopsInf(int shopid)
 {
     using (Entities db = new Entities())
     {
         zfdx_streetshops model  = db.zfdx_streetshops.SingleOrDefault(t => t.zfdx_shopid == shopid);
         zfdx_shopblacks  blacks = db.zfdx_shopblacks.SingleOrDefault(a => a.shopid == shopid);
         if (model != null)
         {
             db.zfdx_streetshops.Remove(model);
         }
         if (blacks != null)
         {
             db.zfdx_shopblacks.Remove(blacks);
         }
         return(db.SaveChanges());
     }
 }
Example #5
0
        public int AddStreetShop(Zfdx_LawStreetStoreModel model)
        {
            using (Entities db = new Entities())
            {
                zfdx_streetshops shops = new zfdx_streetshops();
                shops.address      = model.address;
                shops.businessarea = model.businessarea;
                shops.card         = model.card;
                shops.contactphone = model.contactphone;
                shops.createtime   = DateTime.Now;
                shops.createuserid = model.createuserid;
                shops.e_business   = model.e_business;
                if (model.e_licence != null && model.s_licence != null)
                {
                    shops.e_licence = Convert.ToDateTime(model.e_licence.ToString().Split(' ')[0]);
                    shops.s_licence = Convert.ToDateTime(model.s_licence.ToString().Split(' ')[0]);
                }
                shops.grometry    = model.grometry;
                shops.hawkertype  = model.hawkertype;
                shops.licencecard = model.licencecard;
                shops.person      = model.person;
                shops.remark      = model.remark;
                shops.s_business  = model.s_business;
                shops.shopname    = model.shopname;
                shops.shoptype    = model.shoptype;
                shops.sourcearea  = model.sourcearea;
                shops.sstype      = 1;
                shops.staffsum    = model.staffsum;
                db.zfdx_streetshops.Add(shops);
                db.SaveChanges();

                //店铺-黑名单关系表
                zfdx_shopblacks shopblacks = new zfdx_shopblacks();
                shopblacks.shopid       = shops.zfdx_shopid;
                shopblacks.isblack      = 0; //是否黑名单(0否1是)
                shopblacks.createtime   = DateTime.Now;
                shopblacks.createuserid = shops.createuserid;
                shopblacks.reason       = "";
                db.zfdx_shopblacks.Add(shopblacks);

                return(db.SaveChanges());
            }
        }