コード例 #1
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}
            //验证网址

            var    linkUrl = context.Request["LinkUrl"];
            var    picUrl  = context.Request["PicUrl"];
            string match   = @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
            Regex  reg     = new Regex(match);

            if (!string.IsNullOrEmpty(linkUrl))
            {
                if (!reg.IsMatch(linkUrl))
                {
                    return("请输入正确的网址,格式如 http://www.baidu.com");
                }
            }
            //if (!reg.IsMatch(picurl))
            //{
            //     return "请输入正确的图片地址,格式如 http://www.baidu.com/icon/demo.png";
            //}

            WeixinMsgSourceInfo model = new WeixinMsgSourceInfo();

            model.UserID      = websiteOwner;//Comm.DataLoadTool.GetCurrUserID();
            model.Title       = context.Request["SourceName"];
            model.PicUrl      = picUrl;
            model.Url         = linkUrl;
            model.SourceID    = bll.GetGUID(ZentCloud.BLLJIMP.TransacType.WeixinSourceAdd);
            model.Description = context.Request["Description"];
            return(bll.Add(model).ToString().ToLower());
        }
コード例 #2
0
        /// <summary>
        /// 添加付款记录
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddCrowdFundRecord(HttpContext context)
        {
            CrowdFundRecord model = bllBase.ConvertRequestToModel <CrowdFundRecord>(new CrowdFundRecord());

            model.UserID     = bllBase.GetCurrUserID();
            model.RecordID   = int.Parse(bllBase.GetGUID(ZentCloud.BLLJIMP.TransacType.CommAdd));
            model.InsertDate = DateTime.Now;
            if (model.Amount <= 0)
            {
                resp.Msg = "金额需大于0";
                goto outoff;
            }
            if (bllBase.Add(model))
            {
                resp.Status = 1;
                resp.ExInt  = model.RecordID;
            }
            else
            {
                resp.Status = 0;
                resp.Msg    = "付款失败";
            }
outoff:
            return(Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #3
0
        /// <summary>
        /// 添加
        /// </summary>
        private string Add(HttpContext context)
        {
            var model = new MemberGroupInfo();

            model.UserID    = Comm.DataLoadTool.GetCurrUserID();
            model.GroupName = context.Request["GroupName"];
            model.AddDate   = DateTime.Now;
            model.GroupType = 1;
            model.GroupID   = bll.GetGUID(BLLJIMP.TransacType.MemberGroupAdd);
            return(bll.Add(model).ToString().ToLower());
        }
コード例 #4
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            var model = GetModel(context);

            if (model.RemindTime <= DateTime.Now)
            {
                return("提醒时间须晚于当前时间");
            }
            model.RemindID = Convert.ToInt32(bll.GetGUID(BLLJIMP.TransacType.RemindAdd));
            model.UserID   = Comm.DataLoadTool.GetCurrUserID();
            model.AddDate  = DateTime.Now;
            model.IsEnable = 1;
            model.IsRemind = 0;
            return(bll.Add(model).ToString().ToLower());
        }
コード例 #5
0
ファイル: Add.ashx.cs プロジェクト: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            var    requestModel = ZentCloud.Common.JSONHelper.JsonToModel <ZentCloud.BLLJIMP.ModelGen.PcPage.PcPage>(context.Request["jsonData"]);
            PcPage model        = new PcPage();

            model.PageName      = requestModel.PageName;                                           //页面名称
            model.TopContent    = requestModel.TopContent;                                         //顶部内容
            model.Logo          = requestModel.Logo;                                               //Logo
            model.BottomContent = requestModel.BottomContent;                                      //底部内容
            model.TopMenu       = requestModel.TopMenu;                                            //顶部菜单
            model.MiddContent   = ZentCloud.Common.JSONHelper.ObjectToJson(requestModel.MiddList); //中部列表
            model.WebsiteOwner  = bll.WebsiteOwner;                                                //所有者
            model.PageId        = int.Parse(bll.GetGUID(BLLJIMP.TransacType.CommAdd));
            if (bll.Add(model))
            {
                apiResp.status = true;
            }
            else
            {
                apiResp.msg = "添加失败";
            }
            bll.ContextResponse(context, apiResp);
        }