Esempio n. 1
0
    protected void BackTotal()
    {
        BackDay = Common.TypeHelper.StringToInt(WebFramework.GeneralMethodBase.GetKeyConfig(47).Val);

        if (BackDay > 0)
        {
            BackCount = OrderDal.CheckCount(string.Format(" and FilesId=0 and DateStamp<={0} and IsBack=0", DateTime.Now.AddDays(-BackDay).ToString("yyyyMMdd")));
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //上传小票项目 如有作废原因
            cancelReason = "[\"作废原因1\",\"作废原因2\"]"; //云审核的作废按钮点击会调用vm.MessageBox('Fail', config.orderid, Num, Reason);  num:数组序号 Reason:作废原因

            #region 获取奖项
            Db.AwardsStatisticsDal AwardDal = new Db.AwardsStatisticsDal();
            DataTable AwardList             = AwardDal.GetByColumnList("AwardsName as value,AwardsName as label", " and AwardsType=1 and len(PrizeName)>0");
            AwardsOptions = Common.JsonHelper.DataTableToJson(AwardList);
            #endregion
        }

        orderQty  = dal.CheckCount(" ");
        orderQty1 = dal.CheckCount(" and States=1");  //已完成
        orderQty2 = dal.CheckCount(" and States=-1"); //作废
        orderQty0 = dal.CheckCount(" and States=0");  //待审核
    }
Esempio n. 3
0
    public int GetCount(int DayType, string sqlwhere)
    {
        int count = 0;

        switch (DayType)
        {
        case 0:
            count = ordal.CheckCount(" and datediff(day,[createtime],getdate())=0 " + sqlwhere);
            break;

        case 1:
            count = ordal.CheckCount(" and datediff(day,[createtime],getdate())=1 " + sqlwhere);
            break;

        default:
            count = ordal.CheckCount("" + sqlwhere);
            break;
        }

        return(count);
    }
Esempio n. 4
0
    public int GetCount(int DayType, string sqlwhere)
    {
        int count = 0;

        switch (DayType)
        {
        case 0:
            count = orderDal.CheckCount(" and DateStamp='" + DateTime.Now.ToString("yyyyMMdd") + "' " + sqlwhere);
            break;

        case 1:
            count = orderDal.CheckCount(" and DateStamp='" + DateTime.Now.AddDays(-1).ToString("yyyyMMdd") + "' " + sqlwhere);
            break;

        default:
            count = orderDal.CheckCount("" + sqlwhere);
            break;
        }

        return(count);
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 测试模式时或者管理员 显示删除订单按钮
        if (userseesion.GroupId == 2)//2管理员 22运营经理
        {
            this.delbt.Visible = true;
        }

        #endregion

        if (!IsPostBack)
        {
            bd();

            #region 添加搜索项
            string[] rows   = RowsName.Split(';');
            string[] colums = ColumnName.Split(';');

            for (int i = rows.Length - 1; i > 0; i--)
            {
                if (i.ToString() != "5" && i.ToString() != "9")
                {
                    this.DropDownListName.Items.Insert(0, new ListItem(rows[i], colums[i]));
                }
            }

            this.DropDownListName.Items.Insert(0, new ListItem("选择搜索项", "选择搜索项"));
            #endregion

            //上传小票项目 如有作废原因
            //cancelReason = "['作废原因1','作废原因2']"; //云审核的作废按钮点击会调用send(id,'zf',num,'作废原因1') num:数组序号
        }

        orderQty  = dal.CheckCount(" ");
        orderQty1 = dal.CheckCount(" and States=1");
        orderQty2 = dal.CheckCount(" and States=-1");
        orderQty0 = dal.CheckCount(" and States=0");
    }
Esempio n. 6
0
    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;
    }
Esempio n. 7
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);
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        id = 1;

        if (!IsPostBack)
        {
            if (id > 0)
            {
                Model.ZpConfigModel model = dal.GetModel(id);
                this.txtzjl1.Text  = model.Zjl1.ToString();
                this.txtzjl2.Text  = model.Zjl2.ToString();
                this.txtzjl3.Text  = model.Zjl3.ToString();
                this.txtzjl4.Text  = model.Zjl4.ToString();
                this.txtzjl5.Text  = model.Zjl5.ToString();
                this.txtzjl6.Text  = model.Zjl6.ToString();
                this.txtzjl7.Text  = model.Zjl7.ToString();
                this.txtzjl8.Text  = model.Zjl8.ToString();
                this.txtzjl9.Text  = model.Zjl9.ToString();
                this.txtzjl10.Text = model.Zjl10.ToString();
                this.txtzjl11.Text = model.Zjl11.ToString();
                this.txtzjl12.Text = model.Zjl12.ToString();
                this.txtzjl13.Text = model.Zjl13.ToString();
                this.txtzjl14.Text = model.Zjl14.ToString();
                this.txtzjl15.Text = model.Zjl15.ToString();
                this.txtzjl16.Text = model.Zjl16.ToString();
                this.txtzjl17.Text = model.Zjl17.ToString();
                this.txtzjl18.Text = model.Zjl18.ToString();
                this.txtzjl19.Text = (100 - model.Zjl1 - model.Zjl2 - model.Zjl3 - model.Zjl4 - model.Zjl5 - model.Zjl6).ToString();

                Db.OrderInfoDal ordal = new Db.OrderInfoDal();

                int one_daycont  = ordal.CheckCount(" and Jx='一等奖'");                                            //总
                int one_daycont2 = ordal.CheckCount(" and Jx='一等奖' and datediff(day,[createtime],getdate())=1"); //昨
                int one_daycont3 = ordal.CheckCount(" and Jx='一等奖' and datediff(day,[createtime],getdate())=0"); //今
                this.tday1.InnerText = "昨:" + one_daycont2 + "  今:" + one_daycont3 + "  总:" + one_daycont;

                int two_daycont  = ordal.CheckCount(" and Jx='二等奖'");                                            //总
                int two_daycont2 = ordal.CheckCount(" and Jx='二等奖' and datediff(day,[createtime],getdate())=1"); //昨
                int two_daycont3 = ordal.CheckCount(" and Jx='二等奖' and datediff(day,[createtime],getdate())=0"); //今
                this.tday2.InnerText = "昨:" + two_daycont2 + "  今:" + two_daycont3 + "  总:" + two_daycont;

                int three_daycont  = ordal.CheckCount(" and Jx='三等奖'");                                            //总
                int three_daycont2 = ordal.CheckCount(" and Jx='三等奖' and datediff(day,[createtime],getdate())=1"); //昨
                int three_daycont3 = ordal.CheckCount(" and Jx='三等奖' and datediff(day,[createtime],getdate())=0"); //今
                this.tday3.InnerText = "昨:" + three_daycont2 + "  今:" + three_daycont3 + "  总:" + three_daycont;

                int four_daycont  = ordal.CheckCount(" and Jx='四等奖'");                                            //总
                int four_daycont2 = ordal.CheckCount(" and Jx='四等奖' and datediff(day,[createtime],getdate())=1"); //昨
                int four_daycont3 = ordal.CheckCount(" and Jx='四等奖' and datediff(day,[createtime],getdate())=0"); //今
                this.tday4.InnerText = "昨:" + four_daycont2 + "  今:" + four_daycont3 + "  总:" + four_daycont;

                int five_daycont  = ordal.CheckCount(" and Jx='参与奖'");                                            //总
                int five_daycont2 = ordal.CheckCount(" and Jx='参与奖' and datediff(day,[createtime],getdate())=1"); //昨
                int five_daycont3 = ordal.CheckCount(" and Jx='参与奖' and datediff(day,[createtime],getdate())=0"); //今
                this.tday5.InnerText = "昨:" + five_daycont2 + "  今:" + five_daycont3 + "  总:" + five_daycont;
            }
        }
    }
Esempio n. 9
0
        /// <summary>
        /// 参与统计
        /// </summary>
        /// <returns></returns>
        public Model.ReturnValue GetWheaterStatistics()
        {
            Model.ReturnValue rv = new Model.ReturnValue();

            Dictionary <string, List <SeriesData> > Person = new Dictionary <string, List <SeriesData> >();

            Db.OrderInfoDal        OrderInfoDal        = new Db.OrderInfoDal();
            Db.AwardsStatisticsDal AwardsStatisticsDal = new Db.AwardsStatisticsDal();

            //获取奖项统计订单
            List <Model.AwardsStatisticsModel> AwardsStatisticsList = AwardsStatisticsDal.GetModelList().Where(w => w.AwardsType == 1).ToList();

            #region 昨日

            List <SeriesData> YesterdayData = new List <SeriesData>();
            YesterdayData.Add(new SeriesData()
            {
                name  = "参与人次",
                value = AwardsStatisticsList.Sum(s => s.YesterdayTotal)
            });

            YesterdayData.Add(new SeriesData()
            {
                name  = "中奖人次",
                value = AwardsStatisticsList.Where(w => w.AwardsId != 7).ToList().Sum(s => s.YesterdayTotal)
            });

            YesterdayData.Add(new SeriesData()
            {
                name  = "发奖人次",
                value = OrderInfoDal.CheckCount(string.Format(" and Jx<>'参与奖' and States=1 and DateStamp='{0}'", DateTime.Now.AddDays(-1).ToString("yyyyMMdd")))
            });

            Person.Add("Data1", YesterdayData);

            #endregion

            #region 今日

            List <SeriesData> TodayData = new List <SeriesData>();
            TodayData.Add(new SeriesData()
            {
                name  = "参与人次",
                value = AwardsStatisticsList.Sum(s => s.TodayTotal)
            });

            TodayData.Add(new SeriesData()
            {
                name  = "中奖人次",
                value = AwardsStatisticsList.Where(w => w.AwardsId != 7).ToList().Sum(s => s.TodayTotal)
            });

            TodayData.Add(new SeriesData()
            {
                name  = "发奖人次",
                value = OrderInfoDal.CheckCount(string.Format(" and Jx<>'参与奖' and States=1 and DateStamp='{0}'", DateTime.Now.ToString("yyyyMMdd")))
            });

            Person.Add("Data2", TodayData);

            #endregion

            #region 累计

            List <SeriesData> AllData = new List <SeriesData>();
            AllData.Add(new SeriesData()
            {
                name  = "参与人次",
                value = AwardsStatisticsList.Sum(s => s.AllTotal)
            });

            AllData.Add(new SeriesData()
            {
                name  = "中奖人次",
                value = AwardsStatisticsList.Where(w => w.AwardsId != 7).ToList().Sum(s => s.AllTotal)
            });

            AllData.Add(new SeriesData()
            {
                name  = "发奖人次",
                value = OrderInfoDal.CheckCount(string.Format(" and Jx<>'参与奖' and States=1 "))
            });

            Person.Add("Data3", AllData);

            #endregion

            rv.ObjectValue = Person;
            rv.Success     = true;
            rv.ErrMessage  = "获取成功";

            return(rv);
        }
Esempio n. 10
0
        public string CheckMobOpidIp(string mob, string opid, string Ip)
        {
            Db.OrderInfoDal oddal = new Db.OrderInfoDal();

            string ReturnMsg = "";

            #region 验证手机号参与次数是否超限
            if (string.IsNullOrEmpty(mob) == false)
            {
                int mobCount = 0;

                ReturnMsg = WebFramework.GeneralMethodBase.GetKeyConfig(40).Val;

                int mobAllcont = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(37).Val, 0);
                if (mobAllcont >= 0)
                {
                    mobCount = oddal.CheckCount(string.Format(" and Mob='{0}'", mob));

                    if (mobCount >= mobAllcont)
                    {
                        return(ReturnMsg.Replace("每日", "").Replace("$mob$", mobAllcont.ToString()));;
                    }
                }

                int mobcont = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(34).Val, 0);
                if (mobcont >= 0)
                {
                    mobCount = oddal.CheckCount(string.Format(" and Mob='{0}' and DateStamp='{1}' ", mob, DateTime.Now.ToString("yyyyMMdd")));

                    if (mobCount >= mobcont)
                    {
                        return(ReturnMsg.Replace("$mob$", mobcont.ToString()));;
                    }
                }
            }
            #endregion

            #region 验证Openid参与次数是否超限
            if (string.IsNullOrEmpty(opid) == false)
            {
                int OpenidCount = 0;

                ReturnMsg = WebFramework.GeneralMethodBase.GetKeyConfig(41).Val;

                int opidAllcont = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(38).Val, 0);
                if (opidAllcont >= 0)
                {
                    OpenidCount = oddal.CheckCount(string.Format(" and OpenId='{0}'", opid));

                    if (OpenidCount >= opidAllcont)
                    {
                        return(ReturnMsg.Replace("每日", "").Replace("$opid$", opidAllcont.ToString()));;
                    }
                }

                int opidcont = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(35).Val, 0);
                if (opidcont >= 0)
                {
                    OpenidCount = oddal.CheckCount(string.Format(" and OpenId='{0}' and DateStamp='{1}' ", opid, DateTime.Now.ToString("yyyyMMdd")));

                    if (OpenidCount >= opidcont)
                    {
                        return(ReturnMsg.Replace("$opid$", opidcont.ToString()));
                    }
                }
            }
            #endregion

            #region 验证Ip参与次数是否超限
            if (string.IsNullOrEmpty(Ip) == false)
            {
                int IpCount = 0;

                ReturnMsg = WebFramework.GeneralMethodBase.GetKeyConfig(42).Val;

                int ipAllcont = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(39).Val, 0);
                if (ipAllcont >= 0)
                {
                    IpCount = oddal.CheckCount(string.Format(" and Ip='{0}'", Ip));

                    if (IpCount >= ipAllcont)
                    {
                        return(ReturnMsg);
                    }
                }

                int ipcont = Common.TypeHelper.ObjectToInt(WebFramework.GeneralMethodBase.GetKeyConfig(36).Val, 0);

                if (ipcont >= 0)
                {
                    IpCount = oddal.CheckCount(string.Format(" and Ip='{0}' and DateStamp='{1}' ", Ip, DateTime.Now.ToString("yyyyMMdd")));
                    if (IpCount >= ipcont)
                    {
                        return(ReturnMsg);
                    }
                }
            }
            #endregion

            return("");
        }