예제 #1
0
        private void MsgPagke(MsgPackage obj)
        {
            var checkIsExit = MsgBLL.CheckSellerMsgTransIsExit(obj.SellerNick);

            obj.ServiceStatus = true;
            if (String.IsNullOrEmpty(checkIsExit))//卖家第一次订购
            {
                MsgBLL.AddMsgTrans(obj);
            }
            else if (Convert.ToBoolean(checkIsExit))//如果成立,表示卖家短信套餐还未用完时继续充值,则叠加之前的短信条数
            {
                MsgBLL.UpdateMsgTransForSecond(obj);
            }
            else//表示卖家之前的短信套餐已经用完,再次充值。
            {
                MsgBLL.UpdateMsgTrans(obj);
            }
        }
예제 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var checkIsExit = MsgBLL.CheckSellerMsgTransIsExit(txtNick.Text.Trim());

            if (String.IsNullOrEmpty(checkIsExit))//卖家第一次订购
            {
                MsgPackage obj = new MsgPackage();
                obj.PackageName = "店铺管家短信套餐(淘宝)" + txtCount.Text.Trim() + "条";
                obj.Type        = "赠送短信";
                obj.SellerNick  = txtNick.Text.Trim();
                obj.Price       = 0;
                obj.PerPrice    = "0";
                obj.Rank        = "短信套餐(赠送)";
                obj.OrderDate   = DateTime.Now;
                obj.PayStatus   = true;
                MsgBLL.AddMsgPackage(obj);
                obj.CanUseStartDate = DateTime.Now;
                obj.MsgCanUseCount  = Convert.ToInt32(txtCount.Text.Trim());
                obj.MsgTotalCount   = Convert.ToInt32(txtCount.Text.Trim());
                obj.ServiceStatus   = true;
                MsgBLL.AddMsgTrans(obj);
                lbMsg.Text = "增加成功";
            }
            else
            {
                MsgPackage obj = new MsgPackage();
                obj.PackageName = "店铺管家短信套餐(淘宝)" + txtCount.Text.Trim() + "条";
                obj.Type        = "赠送短信";
                obj.SellerNick  = txtNick.Text.Trim();
                obj.Price       = 0;
                obj.PerPrice    = "0";
                obj.Rank        = "短信套餐(手动添加)";
                obj.OrderDate   = DateTime.Now;
                obj.PayStatus   = true;
                MsgBLL.AddMsgPackage(obj);
                obj.MsgCanUseCount = Convert.ToInt32(txtCount.Text.Trim());
                obj.MsgTotalCount  = Convert.ToInt32(txtCount.Text.Trim());
                MsgBLL.UpdateMsgTransForSecond(obj);
                lbMsg.Text = "追加成功";
            }
        }
예제 #3
0
        private void MsgPagke(MsgPackage obj)
        {
            bool b           = false;
            var  checkIsExit = MsgBLL.CheckSellerMsgTransIsExit(obj.SellerNick);

            obj.ServiceStatus = true;
            if (String.IsNullOrEmpty(checkIsExit))//卖家第一次订购
            {
                b = MsgBLL.AddMsgTrans(obj);
            }
            else if (Convert.ToBoolean(checkIsExit))//如果成立,表示卖家短信套餐还未用完时继续充值,则叠加之前的短信条数
            {
                b = MsgBLL.UpdateMsgTransForSecond(obj);
            }
            else//表示卖家之前的短信套餐已经用完,再次充值。
            {
                b = MsgBLL.UpdateMsgTrans(obj);
            }

            File.AppendAllText(@"D:\log\UpdateMsgTrans.txt", b.ToString(), Encoding.Default);
        }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         //检查卖家是否为新卖家
         var result = SellersBLL.CheckSeller();
         if (result == "0")
         {
             Response.Redirect("http://container.api.taobao.com/container/transform?appkey=21088197", false);
         }
         //ExceptionReporter.WriteLog("result2:" + result, ExceptionPostion.TBApply_Data, ExceptionRank.important);
         if (!string.IsNullOrEmpty(Users.OrderVersion))
         {
             var checkIsExit = MsgBLL.CheckSellerMsgTransIsExit(Users.Nick);
             if (String.IsNullOrEmpty(checkIsExit))//卖家第一次订购
             {
                 MsgPackage obj = new MsgPackage();
                 obj.PackageName = "店铺管家短信套餐(淘宝)10条";
                 obj.Type        = "永久有效";
                 obj.SellerNick  = Users.Nick;
                 obj.Price       = 0;
                 obj.PerPrice    = "0";
                 obj.Rank        = "短信套餐(赠送)";
                 obj.OrderDate   = DateTime.Now;
                 obj.PayStatus   = true;
                 MsgBLL.AddMsgPackage(obj);
                 obj.ServiceStatus   = true;
                 obj.CanUseStartDate = DateTime.Now;
                 obj.MsgCanUseCount  = 10;
                 obj.MsgTotalCount   = 10;
                 MsgBLL.AddMsgTrans(obj);
             }
         }
         else
         {
             Response.Redirect("http://crm.new9channel.com/relogin.aspx");
         }
     }
 }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    var result = SellersBLL.CheckSeller();
                    if (result == "0")
                    {
                        //Response.Redirect("http://container.api.taobao.com/container/transform?appkey=21088197", false);
                        Response.Redirect("error_root.aspx");
                    }

                    userName     = Users.Nick == null ? "未登录的用户" : Users.Nick;
                    orderVersion = string.IsNullOrEmpty(Users.OrderVersion) ? "最高版本" : Users.OrderVersion.ToString();
                    deadline     = Users.Deadline == null ? "当前" : Users.Deadline.Substring(0, 10);
                    SellersBLL.UpdateUnUseDate(deadline, userName); //20161106 yao
                    var checkIsExit = MsgBLL.CheckSellerMsgTransIsExit(Users.Nick);
                    if (String.IsNullOrEmpty(checkIsExit))          //卖家第一次订购
                    {
                        MsgPackage obj = new MsgPackage();
                        if (Users.OrderVersion == "订购一年送3000条短信")
                        {
                            obj.PackageName = "店铺管家短信套餐(淘宝)3000条";
                            obj.Type        = "永久有效";
                            obj.SellerNick  = Users.Nick;
                            obj.Price       = 0;
                            obj.PerPrice    = "0";
                            obj.Rank        = "短信套餐(赠送)";
                            obj.OrderDate   = DateTime.Now;
                            obj.PayStatus   = true;
                            MsgBLL.AddMsgPackage(obj);
                            obj.ServiceStatus   = true;
                            obj.CanUseStartDate = DateTime.Now;
                            obj.MsgCanUseCount  = 3000;
                            obj.MsgTotalCount   = 3000;
                            MsgBLL.AddMsgTrans(obj);
                        }
                        else
                        {
                            TimeSpan sp = Convert.ToDateTime(deadline) - DateTime.Now;
                            if (sp.Days > 15)
                            {
                                obj.PackageName = "店铺管家短信套餐(淘宝)200条";
                                obj.Type        = "永久有效";
                                obj.SellerNick  = Users.Nick;
                                obj.Price       = 0;
                                obj.PerPrice    = "0";
                                obj.Rank        = "短信套餐(赠送)";
                                obj.OrderDate   = DateTime.Now;
                                obj.PayStatus   = true;
                                MsgBLL.AddMsgPackage(obj);
                                obj.ServiceStatus   = true;
                                obj.CanUseStartDate = DateTime.Now;
                                obj.MsgCanUseCount  = 200;
                                obj.MsgTotalCount   = 200;
                                MsgBLL.AddMsgTrans(obj);
                            }
                            else
                            {
                                obj.PackageName = "店铺管家短信套餐(淘宝)10条";
                                obj.Type        = "永久有效";
                                obj.SellerNick  = Users.Nick;
                                obj.Price       = 0;
                                obj.PerPrice    = "0";
                                obj.Rank        = "短信套餐(赠送)";
                                obj.OrderDate   = DateTime.Now;
                                obj.PayStatus   = true;
                                MsgBLL.AddMsgPackage(obj);
                                obj.ServiceStatus   = true;
                                obj.CanUseStartDate = DateTime.Now;
                                obj.MsgCanUseCount  = 10;
                                obj.MsgTotalCount   = 10;
                                MsgBLL.AddMsgTrans(obj);
                            }
                        }

                        OpenLogistics(obj.SellerNick);
                    }
                    DataTable tb = MsgBLL.GetSellerMsgStatus(Users.Nick);
                    if (tb != null && tb.Rows.Count > 0)
                    {
                        msgCount = tb.Rows[0]["msgCanUseCount"].ToString() + "条";
                    }
                    else
                    {
                        msgCount = "0条";
                    }
                    //string medo = @" <div><a href='{1}'><lable style='float: left'>{0}</lable><br /></a></div>";
                    //DataTable dt = SystemMessagesBLL.QueryShowMsg();
                    //if (dt == null || dt.Rows.Count <= 0)
                    //{ return; }
                    //systemMsg = "";
                    //for (int i = 0; i < dt.Rows.Count; i++)
                    //{

                    //    systemMsg += string.Format(medo, dt.Rows[i]["SystemMsg"].ToString(), dt.Rows[i]["SystemLink"].ToString());
                    //}
                }
                catch (Exception ex)
                {
                    ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI);
                }
                finally
                {
                    DataTable tb = MsgBLL.GetSellerMsgStatus(Users.Nick);
                    if (tb != null && tb.Rows.Count > 0)
                    {
                        msgCount = tb.Rows[0]["msgCanUseCount"].ToString() + "条";
                    }
                    else
                    {
                        msgCount = "0条";
                    }
                }
            }
        }