Пример #1
0
 public object EditxfApi(Zfdx_LawStreetStoreModel model)
 {
     try
     {
         int success = bll.Editxf(model);
         if (success > 0)
         {
             return(new
             {
                 msg = "成功",
                 resCode = 1
             });
         }
         else
         {
             return(new
             {
                 msg = "失败",
                 resCode = 0
             });
         }
     }
     catch (Exception)
     {
         return(new
         {
             msg = "上报失败",
             resCode = 0
         });
     }
 }
Пример #2
0
 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);
         }
     }
 }
Пример #3
0
 public object AddHawkerApi(Zfdx_LawStreetStoreModel model)
 {
     try
     {
         int success = bll.AddHawker(model);
         if (success > 0)
         {
             return(new
             {
                 msg = "添加成功",
                 resCode = 1
             });
         }
         else
         {
             return(new
             {
                 msg = "添加失败",
                 resCode = 0
             });
         }
     }
     catch (Exception)
     {
         return(new
         {
             msg = "添加失败",
             resCode = 0
         });
     }
 }
Пример #4
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());
            }
        }
Пример #5
0
        public HttpResponseMessage ModifyStreetShopInf(Zfdx_LawStreetStoreModel model)
        {
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            int success = bll.ModifyStreetShopInf(model);

            if (success > 0)
            {
                response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            return(response);
        }
Пример #6
0
        public HttpResponseMessage AddStreetShop(Zfdx_LawStreetStoreModel model)
        {
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            HttpRequestBase     request  = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;

            if (!string.IsNullOrEmpty(request.Form["userid"]))
            {
                model.createuserid = Convert.ToInt32(request.Form["userid"]);
            }
            int success = bll.AddStreetShop(model);

            if (success > 0)
            {
                response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            return(response);
        }
Пример #7
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());
            }
        }
Пример #8
0
        public Zfdx_LawStreetStoreModel GetStreetShopsInf(int shopid)
        {
            Zfdx_LawStreetStoreModel model = new Zfdx_LawStreetStoreModel();

            using (Entities db = new Entities())
            {
                IQueryable <Zfdx_LawStreetStoreModel> queryable = from a in db.zfdx_streetshops
                                                                  join b_join in db.base_zds.Where(a => a.zd_type == "type_djlx") on a.shoptype equals b_join.zd_id into bTmp
                                                                  from b in bTmp.DefaultIfEmpty()
                                                                  join c_join in db.base_zds.Where(a => a.zd_type == "type_yjdj_ssqy") on a.sourcearea equals c_join.zd_id into cTmp
                                                                  from c in cTmp.DefaultIfEmpty()
                                                                  where a.zfdx_shopid == shopid && a.sstype == 1
                                                                  select new Zfdx_LawStreetStoreModel
                {
                    zfdx_shopid    = a.zfdx_shopid,
                    address        = a.address,
                    businessarea   = a.businessarea,
                    card           = a.card,
                    contactphone   = a.contactphone,
                    e_business     = a.e_business,
                    e_licence      = a.e_licence,
                    grometry       = a.grometry,
                    hawkertype     = a.hawkertype,
                    licencecard    = a.licencecard,
                    person         = a.person,
                    remark         = a.remark,
                    s_business     = a.s_business,
                    s_licence      = a.s_licence,
                    shopname       = a.shopname,
                    shoptype       = a.shoptype,
                    sourcearea     = a.sourcearea,
                    sstype         = a.sstype,
                    staffsum       = a.staffsum,
                    createtime     = a.createtime,
                    createuserid   = a.createuserid,
                    shoptypename   = b.zd_name,
                    sourceareaname = c.zd_name,
                };
                model = queryable.FirstOrDefault();
                return(model);
            }
        }
Пример #9
0
 public int Editxf(Zfdx_LawStreetStoreModel model)
 {
     return(dal.Editxf(model));
 }
Пример #10
0
 public int AddHawker(Zfdx_LawStreetStoreModel model)
 {
     return(dal.AddHawker(model));
 }
Пример #11
0
 public int ModifyStreetShopInf(Zfdx_LawStreetStoreModel model)
 {
     return(dal.ModifyStreetShopInf(model));
 }
Пример #12
0
 public int AddStreetShop(Zfdx_LawStreetStoreModel model)
 {
     return(dal.AddStreetShop(model));
 }