コード例 #1
0
ファイル: ChooseSeatDAL.cs プロジェクト: chenyigg/CinemaProj
        public int insertOrder(OrderInfoModel orderInfoModel, out string orderID)
        {
            string sql = "insert into OrderInfo values(@money,@id,@time,@movieName,@address,@officeID,@chipID,@isPay,@payTime)";
            int    a   = SqlHelper.ExecuteNonQuery(sql, System.Data.CommandType.Text,
                                                   new SqlParameter("@money", orderInfoModel.OrderSumMoney),
                                                   new SqlParameter("@id", orderInfoModel.UsersID),
                                                   new SqlParameter("@time", DateTime.Now),
                                                   new SqlParameter("@movieName", orderInfoModel.MovieName),
                                                   new SqlParameter("@address", orderInfoModel.CinemaAddress),
                                                   new SqlParameter("@officeID", orderInfoModel.OfficeID),
                                                   new SqlParameter("@chipID", orderInfoModel.OfficeID),
                                                   new SqlParameter("@isPay", orderInfoModel.IsPay),
                                                   new SqlParameter("@payTime", orderInfoModel.PayTime)
                                                   );

            orderID = "-1";
            string        sql2   = "  select top 1 * from OrderInfo order by OrderID desc";
            SqlDataReader reader = SqlHelper.GetSqlDataReader(sql2);

            while (reader.Read())
            {
                OrderInfoModel order = new OrderInfoModel(reader);
                orderID = order.OrderID.ToString();
                break;
            }

            return(a);
        }
コード例 #2
0
ファイル: prize.aspx.cs プロジェクト: quwujin/SM297
    protected void Page_Load(object sender, EventArgs e)
    {
        #region   线控制
        string txt = WebFramework.GeneralMethodBase.CheckStartOrEnd();
        if (string.IsNullOrEmpty(txt) == false)
        {
            this.lbErr.Text = txt;
        }
        #endregion

        #region 系统维护开关
        string WhTxt = WebFramework.GeneralMethodBase.IsCheckWH();
        if (string.IsNullOrEmpty(WhTxt) == false)
        {
            this.lbErr.Text = WhTxt;
            return;
        }
        #endregion

        string OpenId = orderSession.OpenId;

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "OpenId异常:" + OpenId);

            Response.Redirect("/default.aspx");
            Response.End();
            return;
        }
        #endregion
        mm = infodal.GetModel(1);
        Model.OrderInfoModel model = dal.GetModel(" and ordercode='" + orderSession.OrderKey + "'");
        if (model.Id > 0)
        {
            if (model.Jx == "一等奖")
            {
                this.Hprize.Value = "1";
                //this.img1.Visible = true;
            }
            else if (model.Jx == "二等奖")
            {
                this.Hprize.Value = "2";
                //this.img2.Visible = true;
            }
            else
            {
                this.Hprize.Value = "0";
                //this.img3.Visible = true;
            }
        }
    }
コード例 #3
0
    public Model.ReturnValue BatchFail()
    {
        if (IsBack)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "作废自动回库暂不支持批量作废!";
            return(returnValue);
        }

        string Delid = Request["BatchId"];

        if (string.IsNullOrEmpty(Delid))
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "请勾选订单!";
            return(returnValue);
        }
        string[] idlist = Delid.Split(',');

        List <Model.OrderInfoModel> orderlist = new List <Model.OrderInfoModel>();

        foreach (string Did in idlist)
        {
            Model.OrderInfoModel ordel = new Model.OrderInfoModel();
            ordel.Id = Common.TypeHelper.ObjectToInt(Did, 0);
            if (ordel.Id > 0)
            {
                orderlist.Add(ordel);
            }
        }
        int delcont = OrderDal.Update(orderlist);

        if (delcont > 0)
        {
            #region 记录操作日志
            mdlog.Description   = "Delid:" + Delid;
            mdlog.OperationType = "批量作废";

            logDal.Add(mdlog);
            #endregion

            returnValue.Success    = true;
            returnValue.ErrMessage = "作废成功!";
            return(returnValue);
        }
        returnValue.Success    = false;
        returnValue.ErrMessage = "作废失败";
        return(returnValue);
    }
コード例 #4
0
    public Model.ReturnValue DelayedOrder(Model.OrderInfoModel model)
    {
        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (model.States != 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单已审核";
            return(returnValue);
        }

        #region 延时订单
        Model.DelayedAwardsModel DelayedAwardsModel = new Model.DelayedAwardsModel();
        DelayedAwardsModel.OrderId     = model.Id;
        DelayedAwardsModel.CreateTime  = DateTime.Now;
        DelayedAwardsModel.DelayedTime = DateTime.Now.AddMinutes(Common.TypeHelper.StringToInt(WebFramework.GeneralMethodBase.GetKeyConfig(51).Val));
        #endregion

        model.States     = 1;
        model.IsGrant    = 0;
        model.Account    = UserSession.UserName;
        model.UpdateTime = DateTime.Now;

        mdlog.Status        = model.States;
        mdlog.Description   = "";
        mdlog.HideContent   = "";
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;
        mdlog.OperationType = "审核通过-转入延时发奖";

        int i = OrderDal.EditAndDelayedOrder(model, mdlog, DelayedAwardsModel);
        if (i > 0)
        {
            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "保存失败";

        return(returnValue);
    }
コード例 #5
0
    public Model.ReturnValue Unable()
    {
        int id = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0);

        model = OrderDal.GetModel(id);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (model.Note.Length > 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单已设置无法审核";
            return(returnValue);
        }

        model.Note       = "无法审核";
        model.Account    = UserSession.UserName;
        model.UpdateTime = DateTime.Now;

        mdlog.OperationType = "无法审核订单";
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;

        int i = OrderDal.EditOrder(model, mdlog);

        if (i > 0)
        {
            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "修改失败";

        return(returnValue);
    }
コード例 #6
0
    public Model.ReturnValue DelayedReissue()
    {
        int id = Common.TypeHelper.ObjectToInt(Request["DelayedId"], 0);

        Model.DelayedAwardsModel DelayedModel = new Db.DelayedAwardsDal().GetModel(id);

        if (DelayedModel.Id <= 0)
        {
            returnValue.ErrMessage = "延时订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (DelayedModel.StatusId != -1)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "延时订单状态非发送失败";
            return(returnValue);
        }

        model = OrderDal.GetModel(DelayedModel.OrderId);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (model.States != 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单已审核";
            return(returnValue);
        }

        //发奖逻辑写完  删除此代码
        returnValue.Success    = false;
        returnValue.ErrMessage = "订单已审核";
        return(returnValue);

        string hideMsg = "";//隐藏串码 短信

        Model.MsgConfigModel msgModel = null;

        if (model.Jx == "一等奖")
        {
            msgModel = MsgConfigDal.GetModel(3);
        }
        else
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "奖项无需审核发奖";
            return(returnValue);
        }

        DelayedModel.StatusId   = 1;
        DelayedModel.UpdateTime = DateTime.Now;

        model.States     = 1;
        model.Account    = UserSession.UserName;
        model.UpdateTime = DateTime.Now;

        model.IsGrant   = 1;
        model.GrantTime = model.UpdateTime;

        mdlog.Status        = model.States;
        mdlog.Description   = hideMsg;
        mdlog.HideContent   = msgModel.MsgTemp;
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;
        mdlog.OperationType = "延时订单发送失败,补发订单";

        int i = OrderDal.EditDelayedOrder(model, mdlog, DelayedModel);

        if (i > 0)
        {
            #region 发送短信
            if (msgModel != null && msgModel.MsgTemp.Length > 10 && model.PrizeCode.Length > 5)
            {
                Common.MessageApi.SendMessage(msgModel.MsgTemp, model.Mob, msgModel.MsgType, msgModel.SupplierId, Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(20).Val, 0), WebFramework.GeneralMethodBase.GetKeyConfig(21).Val);
            }
            #endregion

            #region 大数据录入-请在订单完成时调用该方法
            WebFramework.OrderService.OrderMethod.OrderInstance.AddOrderApi(model);
            #endregion

            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "保存失败";

        return(returnValue);
    }
コード例 #7
0
    public Model.ReturnValue BatchRecorded()
    {
        string Delid = Request["BatchId"];

        if (string.IsNullOrEmpty(Delid))
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "请勾选订单!";
            return(returnValue);
        }

        BDImgApi.APIKey.appUserName = WebFramework.GeneralMethodBase.GetKeyConfig(25).Val;; //
        BDImgApi.APIKey.appKey      = WebFramework.GeneralMethodBase.GetKeyConfig(26).Val;; //
        BDImgApi.APIKey.appSecret   = WebFramework.GeneralMethodBase.GetKeyConfig(27).Val;; //

        //Task<string> task1 = Task.Factory.StartNew<string>(() =>
        //{
        string ResultStr = "";

        try
        {
            string[] idlist = Delid.Split(',');

            List <Model.OrderInfoModel> orderlist = new List <Model.OrderInfoModel>();

            foreach (string Did in idlist)
            {
                int OId = Common.TypeHelper.ObjectToInt(Did, 0);
                if (OId > 0)
                {
                    Model.OrderInfoModel ordel = OrderDal.GetModel(OId);
                    if (ordel.Id > 0)
                    {
                        BDImgApi.GetApiResult Result    = new BDImgApi.GetApiResult();
                        Model.FileInfoModel   FileModel = new Db.FileInfoDal().GetModel(ordel.FilesId);

                        if (FileModel.Id > 0)
                        {
                            ResultStr += Result.GetMatchingImg(FileModel.Hashdata, "1", FileModel.FileName, ordel.OrderCode, false).errMsg + ",";
                        }
                    }
                }
                //Thread.Sleep(20000);
            }
            //return ResultStr;
        }
        catch (Exception ex)
        {
            //return ResultStr;
        }

        //});


        #region 记录操作日志
        mdlog.Description   = "Idlist:" + Delid;
        mdlog.OperationType = "批量OCR预审";

        logDal.Add(mdlog);
        #endregion

        returnValue.Success    = true;
        returnValue.ErrMessage = "成功";
        return(returnValue);
    }
コード例 #8
0
    public Model.ReturnValue Recovery()
    {
        int id = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0);

        model = OrderDal.GetModel(id);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (UserSession.GroupId != 2)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "请联系管理员执行此操作";
            return(returnValue);
        }

        if (model.States != -1)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单未作废无法恢复";
            return(returnValue);
        }

        model.States     = 0;
        model.UpdateTime = DateTime.Now;

        mdlog.Status        = model.States;
        mdlog.OperationType = "恢复订单状态";
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;

        int i = 0;

        if (IsBack)
        {
            #region Check中奖数是否已满
            List <Model.AwardsStatisticsModel> AwardsList = new Db.AwardsStatisticsDal().GetModelList().Where(w => (w.AwardsId == model.AwardId && w.AwardsType == 1) || (w.AwardsId == model.RedAwardId && w.AwardsType == 2)).ToList();
            if (AwardsList.Count == 0)
            {
                returnValue.Success    = false;
                returnValue.ErrMessage = "系统错误,请联系管理员";
                return(returnValue);
            }
            foreach (var AwardsModel in AwardsList)
            {
                string sqlwhere = "";
                if (AwardsModel.AwardsType == 1)
                {
                    sqlwhere = string.Format(" and AwardId={0} and IsBack=0", model.AwardId);
                }
                if (AwardsModel.AwardsType == 2)
                {
                    sqlwhere = string.Format(" and RedAwardId={0} and IsBack=0", model.RedAwardId);
                }

                if (OrderDal.CheckCount(sqlwhere) >= GetPrizeCount(AwardsModel.AwardsType, AwardsModel.AwardsName))
                {
                    returnValue.Success    = false;
                    returnValue.ErrMessage = "奖项总数已达上限,无法恢复订单";
                    return(returnValue);
                }
            }
            #endregion

            i = OrderDal.Recovery(model, mdlog);
        }
        else
        {
            i = OrderDal.EditOrder(model, mdlog);
        }

        if (i > 0)
        {
            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "修改失败";

        return(returnValue);
    }
コード例 #9
0
    public Model.ReturnValue ProcessUpdateInfo(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");

            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Name   = context.Request["name"];
        string Mobile = context.Request["mob"];
        string Adds   = context.Request["adds"];

        int orderId = Common.TypeHelper.ObjectToInt(orderSession.Id, 0);

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("OpenId格式不正确", OpenId, Mobile);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile, OpenId);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证姓名
        if (Common.ValidateHelper.IsName(Name) == false || Name.Length > 12)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Name, Mobile);

            result.ErrMessage = "请填写正确姓名";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证地址

        if (Common.ValidateHelper.IsAddrs(Adds) == false || Adds.Length > 100)
        {
            ESLogMethod.ESLogInstance.Debug("地址错误", Adds, Mobile);

            result.ErrMessage = "请填写正确地址";
            result.Success    = false;
            return(result);
        }
        #endregion

        lock (_PrizeLock)
        {
            #region 验证订单Id
            Model.OrderInfoModel orderdel = oddal.GetModel(orderId);
            if (orderId <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("订单ID不存在", orderId.ToString(), Mobile);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            if (orderdel.Types > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = false;
                return(result);
            }
            if (OpenId != orderdel.OpenId)
            {
                ESLogMethod.ESLogInstance.Debug("订单OpenId不匹配", OpenId, orderId.ToString());

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            #endregion

            orderdel.Name      = Name;
            orderdel.Adds      = Adds;
            orderdel.Types     = 1;
            orderdel.States    = 0;
            orderdel.PrizeCode = "";
            orderdel.Mob       = Mobile;

            #region 调取资源库串码
            //string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetYHPsiAPI(0, 0, orderdel.Mob, orderdel.OrderCode);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;

            //}
            #endregion

            #region 调取优酷串码
            //string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetAPIClient(0, 0, orderdel.Mob, orderdel.OrderCode, WebFramework.GeneralMethodBase.GetKeyConfig(22).Val);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;
            //}
            #endregion

            Model.OrderLogModel OrderLog = new Model.OrderLogModel();
            OrderLog.OId       = orderdel.Id;
            OrderLog.Mob       = Mobile;
            OrderLog.OrderCode = orderdel.PrizeCode;
            OrderLog.LStatus   = 8;//上传信息
            OrderLog.Notes     = orderdel.Name + ";" + orderdel.Adds;
            OrderLog.Status    = 1;
            OrderLog.UpTime    = DateTime.Now;

            if (oddal.UpdateInfo(orderdel, OrderLog) > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }

            ESLogMethod.ESLogInstance.Error("修改订单失败", orderId.ToString(), Mobile);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
    }
コード例 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region   线控制

            string txt = WebFramework.GeneralMethodBase.CheckStartOrEnd();
            if (string.IsNullOrEmpty(txt) == false)
            {
                this.lbErr.Text = txt;
            }

            #endregion
            #region 系统维护开关

            string WhTxt = WebFramework.GeneralMethodBase.IsCheckWH();
            if (string.IsNullOrEmpty(WhTxt) == false)
            {
                this.lbErr.Text = WhTxt;
                return;
            }

            #endregion
            string OpenId = orderSession.OpenId;
            #region 验证OpenId

            if (Common.ValidateHelper.IsOpenid(OpenId) == false)
            {
                WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "OpenId异常:" + OpenId);

                Response.Redirect("/default.aspx");
                Response.End();
                return;
            }

            #endregion

            mm = infodal.GetModel(1);

            #region default的代码优化到这儿
            //todo  1.订单生成上传小票填写手机号2.大转盘抽奖3.二等奖领奖地址界面
            //states -1:已作废;0:待审核;1:已完成;2:未上传;3:已抽奖

            //todo  1.初次进入,进入首页,生成订单 上传小票,未抽奖  states = 2
            //todo
            //todo  3.抽完奖    states = 3
            //todo  4.若是二等奖  未填写地址信息  states = 31
            //todo  5.填写完地址信息,待审核    states = 0
            //todo  6.若是一等奖,待审核    states = 0


            //填完手机号未抽奖
            Model.OrderInfoModel model2 = dal.GetModel(" and openid='" + OpenId + "' and states=2");
            if (model2.Id > 0)
            {
                orderSession.OrderKey = model2.OrderCode;
                SessionMethod.SessionInstance.SetSession(orderSession);
                //WebFramework.GeneralMethodBase.SetSession(orderSession);
                Response.Redirect("lottery.aspx");
            }
            //抽中二等奖,未填写地址信息    地址页信息
            Model.OrderInfoModel model3 = dal.GetModel(" and openid='" + OpenId + "' and states=3");
            if (model3.Id > 0)
            {
                orderSession.OrderKey = model3.OrderCode;
                SessionMethod.SessionInstance.SetSession(orderSession);
                //WebFramework.GeneralMethodBase.SetSession(orderSession);
                Response.Redirect("prize.aspx");
            }


            #endregion
        }
    }
コード例 #11
0
    public Model.ReturnValue Success()
    {
        int id = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0);

        model = OrderDal.GetModel(id);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (model.States != 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单已审核";
            return(returnValue);
        }

        #region 延时发奖(失败则正常发放)
        if (Common.TypeHelper.StringToInt(WebFramework.GeneralMethodBase.GetKeyConfig(49).Val) > 0 && model.IsGrant != -1)
        {
            DelayedOrder(model);

            return(returnValue);
        }
        #endregion

        string hideMsg = "";//隐藏串码 短信
        Model.MsgConfigModel msgModel = null;

        if (model.Jx == "一等奖")
        {
            msgModel = MsgConfigDal.GetModel(3);

            #region 发送红包
            //Common.RedPackHelper rp = new Common.RedPackHelper();

            //int moeny = model.RedPackMoney;

            //if (WebFramework.GeneralMethodBase.GetKeyConfig(3).States == 1)
            //{
            //    moeny = 100;
            //}

            //if (WebFramework.GeneralMethodBase.GetKeyConfig(6).Val.ToLower() == "false") //红包开关
            //{
            //    returnValue.Success = false;
            //    returnValue.ErrMessage = "微信红包发放未开启,请联系管理员";
            //    return returnValue;
            //}

            //int acid = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(29).Val, 0);
            //int hid = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(52).Val, 0);
            //string ckey = WebFramework.GeneralMethodBase.GetKeyConfig(30).Val;
            //string hkey = WebFramework.GeneralMethodBase.GetKeyConfig(31).Val;

            //Common.RedPackHelper.result result = rp.send(acid, hid, model.OpenId, model.HbOrderCode, moeny, ckey, hkey);

            //if (result.SendStatus == false)
            //{
            //    returnValue.Success = false;
            //    returnValue.ErrMessage = result.MSG;
            //    return returnValue;
            //}

            #endregion
        }

        else if (model.Jx == "二等奖")
        {
            msgModel = MsgConfigDal.GetModel(4);
        }
        else
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "奖项无需审核发奖";
            return(returnValue);
        }

        model.States     = 1;
        model.Account    = UserSession.UserName;
        model.UpdateTime = DateTime.Now;

        mdlog.Status        = model.States;
        mdlog.Description   = hideMsg;
        mdlog.HideContent   = msgModel.MsgTemp;
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;
        mdlog.OperationType = "审核通过订单";

        int i = OrderDal.EditOrder(model, mdlog);
        if (i > 0)
        {
            #region 发送短信
            if (msgModel != null && msgModel.MsgTemp.Length > 10)
            {
                var a = Common.MessageApi.SendMessage(msgModel.MsgTemp, model.Mob, msgModel.MsgType, msgModel.SupplierId, Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(20).Val, 0), WebFramework.GeneralMethodBase.GetKeyConfig(21).Val);
            }
            #endregion

            #region 大数据录入-请在订单完成时调用该方法
            WebFramework.OrderService.OrderMethod.OrderInstance.AddOrderApi(model);
            #endregion

            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "保存失败";

        return(returnValue);
    }
コード例 #12
0
    public Model.ReturnValue SaveRemark()
    {
        int id = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0);

        model = OrderDal.GetModel(id);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        string nums  = Request["Nums"];  //流水号
        string store = Request["Store"]; //门店名称
        string price = Request["Price"]; //金额
        string times = Request["Times"]; //日期

        #region 验证输入信息
        if (string.IsNullOrEmpty(nums) == false)
        {
            if (Common.ValidateHelper.IsCode(nums) == false)
            {
                returnValue.Success    = false;
                returnValue.ErrMessage = "请输入正确的流水号!";
                return(returnValue);
            }
        }
        if (string.IsNullOrEmpty(store) == false)
        {
            if (Common.ValidateHelper.IsAddrs(store) == false)
            {
                returnValue.Success    = false;
                returnValue.ErrMessage = "请输入正确的门店信息!";
                return(returnValue);
            }
        }
        if (string.IsNullOrEmpty(price) == false)
        {
            if (Common.ValidateHelper.IsNumeric(price) == false)
            {
                returnValue.Success    = false;
                returnValue.ErrMessage = "请输入正确的金额!";
                return(returnValue);
            }
        }
        if (string.IsNullOrEmpty(times) == false)
        {
            if (Common.ValidateHelper.IsDate(times) == false)
            {
                returnValue.Success    = false;
                returnValue.ErrMessage = "请输入正确的时间!";
                return(returnValue);
            }
        }
        #endregion

        model.Title = store;
        model.Texts = nums;
        model.Tdate = times;
        model.Age   = price;

        mdlog.Description   = model.Title + "-" + model.Texts + "-" + model.Tdate + "-" + model.Age;
        mdlog.OperationType = "添加备注";
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;

        if (Convert.ToInt32(new BDImgApi.GetApiResult().CheckProductByWhere(string.Format(" and SerialNumber='{0}' and Note not in ('{1}')", nums, model.OrderCode))) > 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "该流水号小票云审核已有订单录入!";
            return(returnValue);
        }

        if (OrderDal.CheckCount(string.Format(" and Texts='{0}' and Id not in ({1})", nums, model.Id)) > 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "该流水号已存在!";
            return(returnValue);
        }

        int upcont = OrderDal.UpdateAdds(model, mdlog);

        if (upcont > 0)
        {
            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "保存失败";

        return(returnValue);
    }
コード例 #13
0
ファイル: ProcessCodeDraw.cs プロジェクト: quwujin/SM297
    /// <summary>
    /// 二等奖:完善地址信息
    /// </summary>
    /// <param name="context"></param>
    /// <returns></returns>
    public Model.ReturnValue AddAddressInfo(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();
        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog("session", "session不通过", context);
            return(result);
        }
        #endregion

        string OpenId        = orderSession.OpenId;
        string name          = context.Request["name"];          //姓名
        string province      = context.Request["province"];      //省
        string city          = context.Request["city"];          //市
        string area          = context.Request["area"];          //区
        string detailAddress = context.Request["detailAddress"]; //详细地址
        #region 验证地址
        if (Common.ValidateHelper.IsAddrs(province) == false)
        {
            ESLogMethod.ESLogInstance.Debug("省份错误", detailAddress);

            result.ErrMessage = "请填写正确省份";
            result.Success    = false;
            return(result);
        }
        if (Common.ValidateHelper.IsAddrs(city) == false)
        {
            ESLogMethod.ESLogInstance.Debug("城市错误", detailAddress);

            result.ErrMessage = "请填写正确城市";
            result.Success    = false;
            return(result);
        }
        if (Common.ValidateHelper.IsAddrs(detailAddress) == false)
        {
            ESLogMethod.ESLogInstance.Debug("地址错误", detailAddress);

            result.ErrMessage = "请填写正确地址";
            result.Success    = false;
            return(result);
        }
        if (detailAddress.Length > 100)
        {
            ESLogMethod.ESLogInstance.Debug("地址长度超限", detailAddress);

            result.ErrMessage = "地址长度超限";
            result.Success    = false;
            return(result);
        }

        #endregion
        #region 验证名字

        if (Common.ValidateHelper.IsName(name) == false)
        {
            ESLogMethod.ESLogInstance.Debug("名字错误", detailAddress);

            result.ErrMessage = "请填写姓名";
            result.Success    = false;
            return(result);
        }
        #endregion


        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "Openid格式异常:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        //获取未完善信息的二等奖订单
        Model.OrderInfoModel order = OrderDal.GetModel(" and ordercode='" + orderSession.OrderKey + "' and states = 3");
        if (order.Id <= 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "抽奖:订单ID不存在:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }

        order.States   = 0;
        order.Area     = area;
        order.Province = province;
        order.City     = city;
        order.Adds     = detailAddress;
        order.Name     = name;

        Model.OrderLogModel OrderLog = new Model.OrderLogModel();
        OrderLog.OId       = order.Id;
        OrderLog.Mob       = order.Mob;
        OrderLog.OrderCode = order.OrderCode;
        OrderLog.LStatus   = 8;//上传小票
        OrderLog.Notes     = order.FilesId + ";" + order.States + ";" + order.Area + ";" + order.Province + ";" + order.City + ";" + order.Adds + ";" + order.Name;
        OrderLog.Status    = 1;
        OrderLog.UpTime    = DateTime.Now;

        if (OrderDal.UpdateInfo(order, OrderLog) > 0)
        {
            result.ErrMessage = "提交成功";
            result.Notes      = order.Jx;
            result.Success    = true;
            return(result);
        }

        WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "修改地址失败");

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
コード例 #14
0
ファイル: ProcessCodeDraw.cs プロジェクト: quwujin/SM297
    /// <summary>
    /// 抽奖
    /// </summary>
    /// <param name="context"></param>
    /// <returns></returns>
    public Model.ReturnValue GetJx(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();
        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog("session", "session不通过", context);
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "Openid格式异常:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        //获取未抽奖的唯一订单
        Model.OrderInfoModel order = OrderDal.GetModel(" and ordercode='" + orderSession.OrderKey + "' and states = 2");
        if (order.Id <= 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "抽奖:订单ID不存在:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        //如果中足球,完善地址信息
        if (order.Jx == "二等奖")
        {
            order.States = 3;//已抽奖,待完善地址信息
        }
        else
        {
            order.States = 0;
        }
        Model.OrderLogModel OrderLog = new Model.OrderLogModel();
        OrderLog.OId       = order.Id;
        OrderLog.Mob       = order.Mob;
        OrderLog.OrderCode = order.OrderCode;
        OrderLog.LStatus   = 9;//上传小票
        OrderLog.Notes     = order.FilesId + ";" + order.States;
        OrderLog.Status    = 1;
        OrderLog.UpTime    = DateTime.Now;

        if (OrderDal.UpdateInfo(order, OrderLog) > 0)
        {
            result.ErrMessage = "提交成功";
            result.Notes      = order.Jx;
            result.Success    = true;
            return(result);
        }

        WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "修改抽奖状态失败");

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
コード例 #15
0
ファイル: ProcessCodeDraw.cs プロジェクト: quwujin/SM297
    public Model.ReturnValue ProcessUpdateTypes(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog("session", "session不通过", context);
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Code   = orderSession.Code;

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "OpenId格式不正确:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证Code

        Model.OrderInfoModel orderdel = OrderDal.GetModelByCode(Code);
        if (orderdel.Id <= 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "Code不存在:" + Code);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        if (orderdel.Types != 0)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "订单Types异常:" + orderdel.Types);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }

        if (OpenId != orderdel.OpenId)
        {
            WebFramework.GeneralMethodBase.WebDebugLog(Code, "订单OpenId不匹配-订单OpenId:" + orderdel.OpenId + "-OpenId:" + OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        orderdel.Types = 1;

        if (OrderDal.UpdateTypes(orderdel) > 0)
        {
            result.ErrMessage = "提交成功";
            result.Success    = true;
            return(result);
        }

        ESLogMethod.ESLogInstance.Error("修改订单失败", Code);

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
コード例 #16
0
ファイル: ProcessCodeDraw.cs プロジェクト: quwujin/SM297
    public Model.ReturnValue ProcessUpdateInfo(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Code   = orderSession.Code;
        string Name   = context.Request["name"];
        string Mobile = context.Request["mob"];
        string Adds   = context.Request["adds"];

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("Openid格式异常", OpenId, Code);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile, Code);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证姓名
        if (Common.ValidateHelper.IsName(Name) == false || Name.Length > 12)
        {
            ESLogMethod.ESLogInstance.Debug("姓名错误", Name, Code);

            result.ErrMessage = "请填写正确姓名";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证地址

        if (Common.ValidateHelper.IsAddrs(Adds) == false || Adds.Length > 100)
        {
            ESLogMethod.ESLogInstance.Debug("地址错误", Adds, Code);

            result.ErrMessage = "请填写正确地址";
            result.Success    = false;
            return(result);
        }
        #endregion

        lock (_PrizeLock)
        {
            Model.OrderInfoModel orderdel = OrderDal.GetModelByCode(Code);

            #region 验证Code订单状态
            if (orderdel.Id <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("Code不存在", Code, Mobile);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }

            if (orderdel.Types != 0)
            {
                ESLogMethod.ESLogInstance.Debug("订单Types异常", orderdel.Types.ToString(), Code);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }

            if (OpenId != orderdel.OpenId)
            {
                ESLogMethod.ESLogInstance.Debug("订单OpenId不匹配", OpenId, Code);

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }

            if (orderdel.States > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }
            #endregion

            orderdel.Name      = Name;
            orderdel.Adds      = Adds;
            orderdel.Types     = 1;
            orderdel.States    = 0;
            orderdel.PrizeCode = "";
            orderdel.Mob       = Mobile;

            #region 延时发放奖品

            if (WebFramework.PrivacyDemand.PrivacyMethod.PrivacyInstance.DelayedMethod(orderdel.Id))
            {
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }
            #endregion

            #region 调取资源库串码
            string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetEswAPI(0, 0, orderdel.Mob, orderdel.OrderCode);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;

            //}
            #endregion

            #region 调取优酷串码
            //string codes = WebFramework.OrderService.OrderMethod.OrderInstance.GetAPIClient(0, 0, orderdel.Mob, orderdel.OrderCode, WebFramework.GeneralMethodBase.GetKeyConfig(22).Val);

            //if (string.IsNullOrEmpty(codes) == false)
            //{
            //    orderdel.PrizeCode = codes;
            //    orderdel.States = 1;
            //}
            #endregion

            Model.OrderLogModel OrderLog = new Model.OrderLogModel();
            OrderLog.OId       = orderdel.Id;
            OrderLog.Mob       = Mobile;
            OrderLog.OrderCode = orderdel.PrizeCode;
            OrderLog.LStatus   = 8;//上传信息
            OrderLog.Notes     = orderdel.Name + ";" + orderdel.Adds;
            OrderLog.Status    = 1;
            OrderLog.UpTime    = DateTime.Now;

            if (OrderDal.UpdateInfo(orderdel, OrderLog) > 0)
            {
                #region 大数据录入-请在订单完成时调用该方法
                if (orderdel.States == 1)
                {
                    WebFramework.OrderService.OrderMethod.OrderInstance.AddOrderApi(orderdel);
                }
                #endregion

                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }

            ESLogMethod.ESLogInstance.Error("修改订单失败", Code);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
    }
コード例 #17
0
ファイル: ProcessCodeDraw.cs プロジェクト: quwujin/SM297
    //生成订单
    public Model.ReturnValue ProcessCode(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");

            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Mobile = context.Request["mob"];
        //string Code = context.Request["code"];

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("Openid格式异常", OpenId);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        string Ip     = Common.ClientIP.GetIp();
        int    FileId = orderSession.FileId;
        #region 检查IP
        if (Db.Security.IpAccessControlDal.CheckIpIsOK(false, CacheBase.IPSettingModel, Ip, "", "") == false)
        {
            ESLogMethod.ESLogInstance.Debug("IP模型超过限制", Ip);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region //验证激活码
        //if (Common.ValidateHelper.IsCode(Code, 13) == false)
        //{

        //    #region 登记IP
        //    Db.Security.IpAccessControlDal.CheckIpIsOK(true, CacheBase.IPSettingModel, Ip, Code, "激活码格式错误");
        //    #endregion

        //    ESLogMethod.ESLogInstance.Debug("激活码格式错误", Code, Mobile);

        //    result.ErrMessage = "请填写正确的激活码";
        //    result.Success = false;
        //    return result;
        //}
        #endregion

        lock (_SyncLock)
        {
            //Model.PassCodeInfoModel PassCodeModel = PassCodeDal.GetModelByCode(Code);

            #region //验证激活码状态
            //if (PassCodeModel.Id <= 0)
            //{
            //    #region 登记IP
            //    Db.Security.IpAccessControlDal.CheckIpIsOK(true, CacheBase.IPSettingModel, Ip, Code, "库无此激活码");
            //    #endregion

            //    ESLogMethod.ESLogInstance.Debug("激活码不存在", Code, Mobile);

            //    result.ErrMessage = "请填写正确的激活码";
            //    result.Success = false;
            //    return result;
            //}

            //if (PassCodeModel.StatusId == 1)
            //{
            //    Model.OrderInfoModel orderdel = OrderDal.GetModelByCode(Code);

            //    if (orderdel.Id <= 0)
            //    {
            //        #region 登记IP
            //        Db.Security.IpAccessControlDal.CheckIpIsOK(true, CacheBase.IPSettingModel, Ip, Code, "订单无此串码");
            //        #endregion

            //        ESLogMethod.ESLogInstance.Debug("激活码已激活无订单", Code, Mobile);

            //        result.ErrMessage = "请填写正确的激活码";
            //        result.Success = false;
            //        return result;
            //    }

            //    if (orderdel.OpenId != OpenId)
            //    {
            //        ESLogMethod.ESLogInstance.Debug("激活码已绑定其他微信号", OpenId, Code);

            //        result.ErrMessage = "激活码已绑定其他微信号";
            //        result.Success = false;
            //        return result;
            //    }

            //    result.ErrMessage = "提交成功";
            //    result.Success = true;
            //    return result;
            //}
            #endregion

            #region 检查手机号-openid-IP 参与次数是否超限
            string maxcont = WebFramework.OrderService.OrderMethod.OrderInstance.CheckMobOpidIp(Mobile, OpenId, Ip);

            if (string.IsNullOrEmpty(maxcont) == false)
            {
                ESLogMethod.ESLogInstance.Debug("参与次数超限", maxcont);

                result.ErrMessage = maxcont;
                result.Success    = false;
                return(result);
            }
            #endregion


            Model.FileInfoModel filedel = new Db.FileInfoDal().GetModel(FileId);
            if (filedel.Id <= 0)
            {
                WebFramework.GeneralMethodBase.WebDebugLog(OpenId, "小票不存在:" + FileId);

                result.ErrMessage = "请上传小票";
                result.Success    = false;
                return(result);
            }

            #region 验证小票是否重复
            if (Common.TypeHelper.ObjectToBool(WebFramework.GeneralMethodBase.GetKeyConfig(11).Val, true))
            {
                int RepetCount = new Db.OrderInfoDal().CheckFilesRepeatCount(filedel.Hashdata);

                if (RepetCount > 0)
                {
                    filedel.States = -1;
                }
            }
            #endregion

            #region 抽奖-保存订单
            int goid = WebFramework.GeneralMethodBase.GenerationOrderId(0);

            #region 抽奖
            Model.AwardsStatisticsModel PrizeModel = WebFramework.GeneralMethodBase.GetPrize(3, 1);
            #endregion

            Model.OrderInfoModel model = new Model.OrderInfoModel();
            model.OrderCode  = WebFramework.GeneralMethodBase.CreateOrderCode(goid);
            model.Jx         = PrizeModel.AwardsName;
            model.Jp         = PrizeModel.PrizeName;
            model.DateStamp  = DateTime.Now.ToString("yyyyMMdd");
            model.Ip         = Ip;
            model.IpAddress  = string.Join("-", Common.ClientIP.GetArrayAdds(model.Ip));
            model.CreateTime = DateTime.Now;
            model.OpenId     = OpenId;
            model.Mob        = Mobile;

            model.FilesId = FileId;
            if (filedel.States == -1)
            {
                model.States = filedel.States;//-1表示已作废
            }
            else
            {
                model.States = 2;//2------>表示上传未抽奖
            }

            #region 抽取红包奖项
            Model.AwardsStatisticsModel RedPackPrizeModel = new Model.AwardsStatisticsModel();

            if (model.Jp == "微信红包")
            {
                //RedPackPrizeModel = WebFramework.GeneralMethodBase.GetPrize(7, 2);
                //model.HbOrderCode = WebFramework.GeneralMethodBase.CreateHbCode(goid);//创建红包单号
                //model.RedPackMoney = Common.TypeHelper.ObjectToInt(RedPackPrizeModel.PrizeName, 0);//获取红包金额
            }
            #endregion

            #region 节流
            //if (WebFramework.PrivacyDemand.PrivacyMethod.PrivacyInstance.Throttling())
            //{
            //    model.States = 1;
            //}
            #endregion

            //PassCodeModel.Mob = Mobile;
            //PassCodeModel.StatusId = 1;
            //PassCodeModel.ActiveTime = DateTime.Now;
            //PassCodeModel.OpenId = model.OpenId;

            Model.OrderLogModel mdlog = new Model.OrderLogModel();
            mdlog.OId       = 0;
            mdlog.OrderCode = model.OrderCode;
            mdlog.Mob       = Mobile;
            mdlog.UpTime    = DateTime.Now;
            mdlog.LStatus   = 0;
            mdlog.Status    = 1;
            mdlog.Notes     = "";

            int OrderId = 0;//插入订单ID

            //此方法不可替换更改,因与抽奖查询关联
            if (OrderDal.AddOrderInfo_UpdatePassCodeInfo_AddOrderLog(model, null, mdlog, PrizeModel.Id, RedPackPrizeModel.Id, ref OrderId) > 0)
            {
                #region 虚拟订单
                WebFramework.PrivacyDemand.PrivacyMethod.PrivacyInstance.AddFictitiousOrder(model);
                #endregion
                #region 发送自动作废短信
                if (model.States == -1)
                {
                    WebFramework.GeneralMethodBase.GetMsg(2, model.Mob, model.OrderCode);
                }
                #endregion
                orderSession.OrderKey = model.OrderCode;
                SessionMethod.SessionInstance.SetSession(orderSession);
                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);;
            }
            #endregion
        }

        ESLogMethod.ESLogInstance.Error("添加订单失败", Mobile);

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }
コード例 #18
0
    public Model.ReturnValue ReissueHb()
    {
        int id = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0);

        model = OrderDal.GetModel(id);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (model.States != 1)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单未审核";
            return(returnValue);
        }

        string OpenId      = "";
        string HbOrderCode = "";
        int    money       = 0;

        string SearchMsg = "";

        SearchMsg = Common.SearchRedPack.SearchOrder(model.HbOrderCode);
        if (SearchMsg != "已退款" && SearchMsg == "发放失败")
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = SearchMsg;
            return(returnValue);
        }

        OpenId      = model.OpenId;
        HbOrderCode = model.HbOrderCode.Substring(0, 11) + "9" + model.HbOrderCode.Substring(12, 6);
        money       = model.RedPackMoney;

        #region 发送红包
        Common.RedPackHelper rp = new Common.RedPackHelper();

        if (WebFramework.GeneralMethodBase.GetKeyConfig(3).States == 1)
        {
            money = 100;
        }

        if (WebFramework.GeneralMethodBase.GetKeyConfig(6).Val.ToLower() == "false") //红包开关
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "微信红包发放未开启,请联系管理员";
            return(returnValue);
        }

        int    acid = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(29).Val, 0);
        int    hid  = acid;
        string ckey = WebFramework.GeneralMethodBase.GetKeyConfig(30).Val;
        string hkey = WebFramework.GeneralMethodBase.GetKeyConfig(31).Val;

        Common.RedPackHelper.result result2 = rp.send(acid, hid, OpenId, HbOrderCode, money, ckey, hkey);

        if (result2.SendStatus == false)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = result2.MSG;
            return(returnValue);
        }
        #endregion

        mdlog.LStatus       = 0;
        mdlog.Status        = 1;
        mdlog.Description   = "原单号:" + model.HbOrderCode;
        mdlog.HideContent   = "修改后单号:" + HbOrderCode + ",发送金额:" + money;
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;
        mdlog.OperationType = "红包退款-补发红包";

        model.HbOrderCode = HbOrderCode;

        int i = OrderDal.ReissueHb(model, mdlog);
        if (i > 0)
        {
            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "保存失败";

        return(returnValue);
    }
コード例 #19
0
ファイル: UpdateOrder.aspx.cs プロジェクト: quwujin/SM297
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("订单异常");
        Response.End();
        return;

        #region 验证用户登录信息

        Model.UserInfoModel UserSession = GetUserSession();

        if (UserSession == null || new Db.UserInfoDal().Exists(GetUserSession().UserName) == false)
        {
            Response.Write("账户登录已失效,请重新登录~!");
            Response.End();
            return;
        }
        #endregion

        Db.OrderInfoDal      odal    = new Db.OrderInfoDal();
        int                  id      = Common.TypeHelper.ObjectToInt(Request["id"], 0);
        Model.OrderInfoModel model   = odal.GetModel(id);
        string               ty      = Request["ty"];
        string               msg     = "";
        string               hideMsg = "";

        #region 操作日志订单
        Db.Operation_LogDal      logDal = new Db.Operation_LogDal();
        Model.Operation_LogModel mdlog  = new Model.Operation_LogModel();

        mdlog.CreateTime    = DateTime.Now;
        mdlog.Description   = "";
        mdlog.LStatus       = model.States;
        mdlog.Mobile        = model.Mob;
        mdlog.OperationType = "";
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Status        = 0;
        mdlog.UpdateTime    = DateTime.Now;
        mdlog.UserName      = UserSession.UserName;
        mdlog.Remark        = "";
        mdlog.HideContent   = "";
        #endregion

        #region 批量删除
        if (ty == "del")
        {
            string Delid = Request["Delid"];

            if (string.IsNullOrEmpty(Delid))
            {
                Response.Write("请勾选订单!");
                Response.End();
                return;
            }
            string[] idlist = Delid.Split(',');

            List <Model.OrderInfoModel> orderlist = new List <Model.OrderInfoModel>();

            foreach (string Did in idlist)
            {
                Model.OrderInfoModel ordel = new Model.OrderInfoModel();
                ordel.Id = Common.TypeHelper.ObjectToInt(Did, 0);
                if (ordel.Id > 0)
                {
                    orderlist.Add(ordel);
                }
            }
            int delcont = odal.Del(orderlist);

            if (delcont > 0)
            {
                #region 记录操作日志
                mdlog.Description   = "Delid:" + Delid;
                mdlog.OperationType = "批量删除";

                logDal.Add(mdlog);
                #endregion

                Response.Write("删除成功!");
                Response.End();
                return;
            }
            else
            {
                Response.Write("删除失败!");
                Response.End();
                return;
            }
        }
        #endregion

        #region 批量作废
        if (ty == "zflist")
        {
            string Delid = Request["Delid"];

            if (string.IsNullOrEmpty(Delid))
            {
                Response.Write("请勾选订单!");
                Response.End();
                return;
            }
            string[] idlist = Delid.Split(',');

            List <Model.OrderInfoModel> orderlist = new List <Model.OrderInfoModel>();

            foreach (string Did in idlist)
            {
                Model.OrderInfoModel ordel = new Model.OrderInfoModel();
                ordel.Id = Common.TypeHelper.ObjectToInt(Did, 0);
                if (ordel.Id > 0)
                {
                    orderlist.Add(ordel);
                }
            }
            int delcont = odal.Update(orderlist);
            if (delcont > 0)
            {
                #region 记录操作日志
                mdlog.Description   = "Delid:" + Delid;
                mdlog.OperationType = "批量作废";

                logDal.Add(mdlog);
                #endregion

                Response.Write("作废成功!");
                Response.End();
                return;
            }
            else
            {
                Response.Write("作废失败!");
                Response.End();
                return;
            }
        }
        #endregion

        #region 批量OCR预审勾选小票
        if (ty == "recorded")
        {
            string Delid = Request["Delid"];

            if (string.IsNullOrEmpty(Delid))
            {
                Response.Write("请勾选订单!");
                Response.End();
                return;
            }

            BDImgApi.APIKey.appUserName = WebFramework.GeneralMethodBase.GetKeyConfig(25).Val;  //
            BDImgApi.APIKey.appKey      = WebFramework.GeneralMethodBase.GetKeyConfig(26).Val;; //
            BDImgApi.APIKey.appSecret   = WebFramework.GeneralMethodBase.GetKeyConfig(27).Val;; //

            //Task<string> task1 = Task.Factory.StartNew<string>(() =>
            //{
            string ResultStr = "";
            try
            {
                string[] idlist = Delid.Split(',');

                List <Model.OrderInfoModel> orderlist = new List <Model.OrderInfoModel>();

                foreach (string Did in idlist)
                {
                    int OId = Common.TypeHelper.ObjectToInt(Did, 0);
                    if (OId > 0)
                    {
                        Model.OrderInfoModel ordel = odal.GetModel(OId);
                        if (ordel.Id > 0)
                        {
                            BDImgApi.GetApiResult Result    = new BDImgApi.GetApiResult();
                            Model.FileInfoModel   FileModel = new Db.FileInfoDal().GetModel(ordel.FilesId);

                            if (FileModel.Id > 0)
                            {
                                ResultStr += Result.GetMatchingImg(FileModel.Hashdata, "1", FileModel.FileName, ordel.OrderCode, false).errMsg + ",";
                            }
                        }
                    }
                    //Thread.Sleep(20000);
                }
                //return ResultStr;
            }
            catch (Exception ex)
            {
                //return ResultStr;
            }

            //});


            #region 记录操作日志
            mdlog.Description   = "Idlist:" + Delid;
            mdlog.OperationType = "批量OCR预审勾选小票";

            logDal.Add(mdlog);
            #endregion

            Response.Write("成功");
            Response.End();
            return;
        }
        #endregion

        #region 批量OCR预审未录入小票
        if (ty == "recordedAll")
        {
            BDImgApi.APIKey.appUserName = WebFramework.GeneralMethodBase.GetKeyConfig(25).Val;  //
            BDImgApi.APIKey.appKey      = WebFramework.GeneralMethodBase.GetKeyConfig(26).Val;; //
            BDImgApi.APIKey.appSecret   = WebFramework.GeneralMethodBase.GetKeyConfig(27).Val;; //

            string ResultStr = "";
            try
            {
                List <Model.OrderInfoModel> Notorderlist = odal.GetModelNotOCRList();

                foreach (Model.OrderInfoModel NotModel in Notorderlist)
                {
                    if (NotModel.Id > 0)
                    {
                        BDImgApi.GetApiResult Result    = new BDImgApi.GetApiResult();
                        Model.FileInfoModel   FileModel = new Db.FileInfoDal().GetModel(NotModel.FilesId);

                        if (FileModel.Id > 0)
                        {
                            ResultStr += Result.GetMatchingImg(FileModel.Hashdata, "1", FileModel.FileName, NotModel.OrderCode, false).errMsg + ",";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            #region 记录操作日志
            mdlog.Description   = "" + ResultStr;
            mdlog.OperationType = "批量OCR预审未录入小票";

            logDal.Add(mdlog);
            #endregion

            Response.Write("成功");
            Response.End();
            return;
        }
        #endregion

        #region 恢复订单
        if (model.Id > 0 && ty == "back" && model.States == -1)
        {
            if (UserSession.GroupId != 2)
            {
                Response.Write("请联系管理员执行此操作");
                Response.End();
                return;
            }

            model.States = 0;

            mdlog.Status        = model.States;
            mdlog.OperationType = "恢复订单状态";
            model.UpdateTime    = DateTime.Now;

            int i = odal.EditOrder(model, mdlog);
            if (i > 0)
            {
                Response.Write("修改成功");
                Response.End();
                return;
            }
            Response.Write("恢复失败");
            Response.End();
            return;
        }
        #endregion

        #region 审核订单
        if (model.Id > 0 && model.States == 0)
        {
            #region 作废
            if (ty == "zf")
            {
                model.States = -1;
                msg          = WebFramework.GeneralMethodBase.GetMsg(1);

                mdlog.OperationType = "作废订单";
            }
            #endregion

            #region 无法审核
            else if (ty == "no")
            {
                model.Note          = "无法审核";
                mdlog.OperationType = "无法审核订单";

                //if (model.Note == "无法审核") {
                //    model.Note = "";
                //    mdlog.OperationType = "修改无法审核订单状态";
                //}
            }
            #endregion

            #region 添加备注
            else if (ty == "note")
            {
                string nums  = Request["nums"];  //流水号
                string store = Request["store"]; //门店名称
                string price = Request["price"]; //金额
                string times = Request["times"]; //日期

                #region 验证输入信息
                if (string.IsNullOrEmpty(nums) == false)
                {
                    if (Common.ValidateHelper.IsCode(nums) == false)
                    {
                        Response.Write("请输入正确的流水号!");
                        Response.End();
                        return;
                    }
                }
                if (string.IsNullOrEmpty(store) == false)
                {
                    if (Common.ValidateHelper.IsAddrs(store) == false)
                    {
                        Response.Write("请输入正确的门店信息!");
                        Response.End();
                        return;
                    }
                }
                if (string.IsNullOrEmpty(price) == false)
                {
                    if (Common.ValidateHelper.IsNumeric(price) == false)
                    {
                        Response.Write("请输入正确的金额!");
                        Response.End();
                        return;
                    }
                }
                if (string.IsNullOrEmpty(times) == false)
                {
                    if (Common.ValidateHelper.IsDate(times) == false)
                    {
                        Response.Write("请输入正确的时间!");
                        Response.End();
                        return;
                    }
                }
                #endregion

                model.Title = store;
                model.Texts = nums;
                model.Tdate = times;
                model.Age   = price;

                mdlog.Description   = model.Title + "-" + model.Texts + "-" + model.Tdate + "-" + model.Age;
                mdlog.OperationType = "添加备注";

                if (Convert.ToInt32(new BDImgApi.GetApiResult().CheckProductByWhere(string.Format(" and SerialNumber='{0}' and Note not in ('{1}')", nums, model.OrderCode))) > 0)
                {
                    Response.Write("该流水号小票云审核已有订单录入");
                    Response.End();
                    return;
                }

                if (odal.CheckCount(string.Format(" and Texts='{0}' and Id not in ({1})", nums, model.Id)) > 0)
                {
                    Response.Write("该流水号已存在");
                    Response.End();
                    return;
                }

                int upcont = odal.UpdateAdds(model, mdlog);

                if (upcont > 0)
                {
                    Response.Write("添加备注成功");
                    Response.End();
                    return;
                }
            }
            #endregion

            #region 审核通过
            else if (ty == "ok")
            {
                if (model.Jx == "三等奖")
                {
                    #region 发送红包
                    Common.RedPackHelper rp = new Common.RedPackHelper();

                    int moeny = model.RedPackMoney;

                    if (WebFramework.GeneralMethodBase.GetKeyConfig(3).States == 1)
                    {
                        moeny = 100;
                    }

                    if (WebFramework.GeneralMethodBase.GetKeyConfig(6).Val.ToLower() == "false") //红包开关
                    {
                        Response.Write("微信红包发放未开启,请联系管理员");
                        Response.End();
                        return;
                    }

                    int    acid = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(29).Val, 0);
                    int    hid  = acid;
                    string ckey = WebFramework.GeneralMethodBase.GetKeyConfig(30).Val;
                    string hkey = WebFramework.GeneralMethodBase.GetKeyConfig(31).Val;

                    Common.RedPackHelper.result result = rp.send(acid, hid, model.OpenId, model.HbOrderCode, moeny, ckey, hkey);

                    if (result.SendStatus == false)
                    {
                        Response.Write(result.MSG);
                        Response.End();
                        return;
                    }

                    #endregion
                }
                else
                {
                    Response.Write("奖项无需审核发奖");
                    Response.End();
                    return;
                }

                model.States        = 1;
                mdlog.OperationType = "审核通过订单";
            }
            #endregion

            else
            {
                Response.Write("订单异常");
                Response.End();
                return;
            }

            mdlog.Status      = model.States;
            mdlog.Description = hideMsg;//隐藏串码 短信
            mdlog.HideContent = msg;

            model.Account    = UserSession.UserName;
            model.UpdateTime = DateTime.Now;

            int i = odal.EditOrder(model, mdlog);
            if (i > 0)
            {
                #region 发送短信
                if (msg.Length > 10 && model.States == 1 && ty == "ok" && model.PrizeCode.Length > 5)
                {
                    // Common.MessageApi.SendZtMessage(msg, model.Mob, Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(20).Val, 0), WebFramework.GeneralMethodBase.GetKeyConfig(21).Val);
                }
                #endregion

                Response.Write("修改成功");
            }
            else
            {
                Response.Write("修改失败");
            }
            Response.End();
            return;
        }
        #endregion

        Response.Write("订单已审核");
        Response.End();
        return;
    }
コード例 #20
0
    public Model.ReturnValue ProcessUploadFiles(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        int    FileId = orderSession.FileId;

        int orderId = Common.TypeHelper.ObjectToInt(orderSession.Id, 0);

        #region 验证openid
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("OpenId格式不正确", OpenId, orderId.ToString());

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证小票
        Model.FileInfoModel filedel = new Db.FileInfoDal().GetModel(FileId);
        if (filedel.Id <= 0)
        {
            ESLogMethod.ESLogInstance.Debug("小票不存在", FileId.ToString(), orderId.ToString());

            result.ErrMessage = "请上传小票";
            result.Success    = false;
            return(result);
        }

        #region 验证小票是否重复
        if (Common.TypeHelper.ObjectToBool(WebFramework.GeneralMethodBase.GetKeyConfig(11).Val, true))
        {
            int RepetCount = new Db.OrderInfoDal().CheckFilesRepeatCount(filedel.Hashdata);

            if (RepetCount > 0)
            {
                filedel.States = -1;
            }
        }
        #endregion
        #endregion

        lock (_PrizeLock)
        {
            #region 验证订单Id
            Model.OrderInfoModel orderdel = oddal.GetModel(orderId);
            if (orderId <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("订单ID不存在", orderId.ToString());

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            if (orderdel.FilesId > 0)
            {
                result.ErrMessage = "提交成功";
                result.Success    = false;
                return(result);
            }
            if (OpenId != orderdel.OpenId)
            {
                ESLogMethod.ESLogInstance.Debug("OpenId与订单不匹配", OpenId, orderId.ToString());

                result.ErrMessage = "系统繁忙,请稍后再试";
                result.Success    = false;
                return(result);
            }
            #endregion

            orderdel.FilesId = FileId;
            orderdel.States  = filedel.States;

            Model.OrderLogModel OrderLog = new Model.OrderLogModel();
            OrderLog.OId       = orderdel.Id;
            OrderLog.Mob       = orderdel.Mob;
            OrderLog.OrderCode = orderdel.OrderCode;
            OrderLog.LStatus   = 9;//上传小票
            OrderLog.Notes     = orderdel.FilesId + ";" + orderdel.States;
            OrderLog.Status    = 1;
            OrderLog.UpTime    = DateTime.Now;

            if (oddal.UpdateFiles(orderdel, OrderLog) > 0)
            {
                #region 发送自动作废短信
                if (orderdel.States == -1)
                {
                    WebFramework.GeneralMethodBase.GetMsg(2, orderdel.Mob, orderdel.OrderCode);
                }
                #endregion

                #region OCR预录
                if (filedel != null)
                {
                    WebFramework.OrderService.OrderMethod.OrderInstance.OcrRecorded(orderdel.OrderCode, filedel.Hashdata, filedel.FileName);
                }
                #endregion

                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }

            ESLogMethod.ESLogInstance.Error("修改订单失败", orderId.ToString());

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
    }
コード例 #21
0
    public Model.ReturnValue Fail()
    {
        int    id     = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0);
        string reason = Request["popoverVal"];

        model = OrderDal.GetModel(id);

        if (model.Id <= 0)
        {
            returnValue.ErrMessage = "订单不存在";
            returnValue.Success    = false;
            return(returnValue);
        }

        if (model.States != 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "订单已审核";
            return(returnValue);
        }

        Model.MsgConfigModel msgModel = MsgConfigDal.GetModel(1);

        if (msgModel.Id <= 0)
        {
            returnValue.Success    = false;
            returnValue.ErrMessage = "未设置手动作废短信";
            return(returnValue);
        }

        model.States     = -1;
        model.Account    = UserSession.UserName;
        model.UpdateTime = DateTime.Now;

        mdlog.OperationType = "作废订单";
        mdlog.Status        = model.States;
        mdlog.Description   = msgModel.MsgTemp;
        mdlog.HideContent   = mdlog.Description;
        mdlog.OrderCode     = model.OrderCode;
        mdlog.Mobile        = model.Mob;

        int i = 0;

        if (IsBack)
        {
            if (model.IsBack != 0)
            {
                returnValue.Success    = false;
                returnValue.ErrMessage = "订单异常-订单奖项已回库";
                return(returnValue);
            }

            model.IsBack = 1;//奖项回库
            i            = OrderDal.UpdateFail(model, mdlog);
        }
        else
        {
            i = OrderDal.EditOrder(model, mdlog);
        }

        if (i > 0)
        {
            #region 发送短信
            if (mdlog.HideContent.Length > 10)
            {
                var a = Common.MessageApi.SendMessage(msgModel.MsgTemp.Replace("reason", reason), model.Mob, msgModel.MsgType, msgModel.SupplierId, Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(20).Val, 0), WebFramework.GeneralMethodBase.GetKeyConfig(21).Val);
            }
            #endregion

            #region 大数据录入-请在订单完成时调用该方法
            WebFramework.OrderService.OrderMethod.OrderInstance.AddOrderApi(model);
            #endregion

            returnValue.Success = true;
            return(returnValue);
        }

        returnValue.Success    = false;
        returnValue.ErrMessage = "修改失败";

        return(returnValue);
    }
コード例 #22
0
    public Model.ReturnValue ProcessUpload(HttpContext context)
    {
        Model.ReturnValue result = new Model.ReturnValue();

        #region 验证Session
        result = CheckSession();
        if (result.Success == false)
        {
            ESLogMethod.ESLogInstance.Debug("Session不通过", "");
            return(result);
        }
        #endregion

        string OpenId = orderSession.OpenId;
        string Mobile = context.Request["mob"];
        int    FileId = orderSession.FileId;
        string Ip     = Common.ClientIP.GetIp();

        #region 验证OpenId
        if (Common.ValidateHelper.IsOpenid(OpenId) == false)
        {
            ESLogMethod.ESLogInstance.Debug("Openid格式异常", OpenId, Mobile);

            result.ErrMessage = "系统繁忙,请稍后再试";
            result.Success    = false;
            return(result);
        }
        #endregion

        #region 验证手机号
        if (Common.ValidateHelper.IsMobile(Mobile) == false)
        {
            ESLogMethod.ESLogInstance.Debug("手机号错误", Mobile);

            result.ErrMessage = "请填写正确手机号";
            result.Success    = false;
            return(result);
        }
        #endregion

        lock (_SyncLock)
        {
            #region 验证小票
            Model.FileInfoModel filedel = new Db.FileInfoDal().GetModel(FileId);
            if (filedel.Id <= 0)
            {
                ESLogMethod.ESLogInstance.Debug("小票不存在", FileId.ToString(), Mobile);

                result.ErrMessage = "请上传小票";
                result.Success    = false;
                return(result);
            }

            #region 验证小票是否重复
            if (Common.TypeHelper.ObjectToBool(WebFramework.GeneralMethodBase.GetKeyConfig(11).Val, true))
            {
                int RepetCount = new Db.OrderInfoDal().CheckFilesRepeatCount(filedel.Hashdata);

                if (RepetCount > 0)
                {
                    filedel.States = -1;
                }
            }
            #endregion
            #endregion

            #region 检查是否有中奖未完善信息订单

            //Model.OrderInfoModel Nomobdel = oddal.GetModel(string.Format(" Mob='{0}' and Types=0 and Jx<>'参与奖' and States=0", mob));
            //if (Nomobdel.Id > 0)
            //{
            //    orderSession.Id = Nomobdel.Id;

            //    returnErro(context, "true", "提交成功", "");
            //    context.Response.End();
            //    return;
            //}
            #endregion

            #region 检查手机号-openid-IP 参与次数是否超限
            string maxcont = WebFramework.OrderService.OrderMethod.OrderInstance.CheckMobOpidIp(Mobile, OpenId, Ip);

            if (string.IsNullOrEmpty(maxcont) == false)
            {
                ESLogMethod.ESLogInstance.Debug("参与总数超限", maxcont);

                result.ErrMessage = maxcont;
                result.Success    = false;
                return(result);
            }
            #endregion

            #region 抽奖-保存订单
            int goid = WebFramework.GeneralMethodBase.GenerationOrderId(0);

            #region 抽奖
            Model.AwardsStatisticsModel PrizeModel = WebFramework.GeneralMethodBase.GetPrize(7, 1);
            #endregion

            Model.OrderInfoModel model = new Model.OrderInfoModel();

            model.Jx         = PrizeModel.AwardsName;
            model.OrderCode  = WebFramework.GeneralMethodBase.CreateOrderCode(goid);
            model.Jp         = PrizeModel.PrizeName;
            model.States     = filedel.States;
            model.DateStamp  = DateTime.Now.ToString("yyyyMMdd");
            model.Ip         = Ip;
            model.IpAddress  = string.Join("-", Common.ClientIP.GetArrayAdds(model.Ip));
            model.CreateTime = DateTime.Now;
            model.OpenId     = OpenId;
            model.Mob        = Mobile;
            model.FilesId    = FileId;

            #region 抽取红包奖项
            Model.AwardsStatisticsModel RedPackPrizeModel = new Model.AwardsStatisticsModel();
            if (model.Jp == "微信红包")
            {
                //RedPackPrizeModel = WebFramework.GeneralMethodBase.GetPrize(7, 2);
                //model.HbOrderCode = WebFramework.GeneralMethodBase.CreateHbCode(goid);//创建红包单号
                //model.RedPackMoney = Common.TypeHelper.ObjectToInt(RedPackPrizeModel.PrizeName, 0);//获取红包金额
            }
            #endregion

            int OrderId = 0;

            //此方法不可替换更改,因与抽奖查询关联
            if (oddal.AddOrderInfo_UpdatePassCodeInfo_AddOrderLog(model, null, null, PrizeModel.Id, RedPackPrizeModel.Id, ref OrderId) > 0)
            {
                #region 发送自动作废短信
                if (model.States == -1)
                {
                    WebFramework.GeneralMethodBase.GetMsg(2, model.Mob, model.OrderCode);
                }
                #endregion

                #region OCR预录
                if (filedel != null)
                {
                    WebFramework.OrderService.OrderMethod.OrderInstance.OcrRecorded(model.OrderCode, filedel.Hashdata, filedel.FileName);
                }
                #endregion

                orderSession.Id = OrderId;
                WebFramework.SessionManage.SessionMethod.SessionInstance.SetSession(orderSession);

                result.ErrMessage = "提交成功";
                result.Success    = true;
                return(result);
            }
            #endregion
        }

        ESLogMethod.ESLogInstance.Error("添加订单失败", Mobile);

        result.ErrMessage = "系统繁忙,请稍后再试";
        result.Success    = false;
        return(result);
    }