public int Editxf(Zfdx_LawStreetStoreModel model) { using (Entities db = new Entities()) { zfdx_streetshops shops = db.zfdx_streetshops.FirstOrDefault(a => a.zfdx_shopid == model.zfdx_shopid && a.sstype == 2); if (shops != null) { shops.address = model.address; shops.businessarea = model.businessarea; shops.card = model.card; shops.contactphone = model.contactphone; shops.e_business = model.e_business; shops.e_licence = model.e_licence; 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.s_licence = model.s_licence; shops.shopname = model.shopname; shops.shoptype = model.shoptype; shops.sourcearea = model.sourcearea; shops.staffsum = model.staffsum; return(db.SaveChanges()); } else { return(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()); } }
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()); } }
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()); } }