Пример #1
0
        public string CreateActive(ActiveParams param)
        {
            string jsonstr = "";
            try
            {
                var model = new Model.hp_active();
                model.countid = Convert.ToInt32(param.countid);
                model.begintime = Convert.ToDateTime(param.begintime);
                model.lng = Convert.ToDouble(param.lng);
                model.lat = Convert.ToDouble(param.lat);
                model.num = Convert.ToInt32(param.num);
                model.fee = Convert.ToDouble(param.fee);
                model.endtime = Convert.ToDateTime(param.endtime);
                model.image = param.image;
                model.summary = param.summary;
                model.telneed = Convert.ToBoolean(param.telneed);
                model.address = param.address;
                entity.hp_active.Add(model);
                entity.SaveChanges();
                jsonstr = ReturnJson.toJson("100", "成功", -1);
            }
            catch (Exception e)
            {
                jsonstr = ReturnJson.toJson("101", "失败", -1);
            }

            return jsonstr;
        }
Пример #2
0
 private ActiveParams GetParams()
 {
     BLL.ActiveParams param = new ActiveParams();
     param.countid = Request.Form["countid"];
     param.classid = Request.Form["classid"];
     param.begintime = Request.Form["begintime"];
     param.lng = Request.Form["lng"];
     param.lat = Request.Form["lat"];
     param.num = Request.Form["num"];
     param.fee = Request.Form["fee"];
     param.endtime = Request.Form["endtime"];
     param.image = Request.Form["image"];
     param.summary = Request.Form["summary"];
     param.telneed = Request.Form["telneed"];
     param.address = Request.Form["address"];
     return param;
 }