コード例 #1
0
 //添加订单
 protected void Button1_Click(object sender, EventArgs e)
 {
     proModel           = proBll.GetproductByid(Convert.ToInt32(HiddenField2.Value));
     muser              = buser.SeachByID(Convert.ToInt32(HiddenField1.Value));
     Odata.OrderNo      = "DD" + function.GetFileName();
     Odata.Ordersamount = Convert.ToDouble(proModel.LinPrice * Convert.ToInt32(TextBox1.Text));
     Odata.Ordertype    = (int)M_OrderList.OrderEnum.IDC;
     Odata.Receiver     = muser.UserName;
     Odata.Reuser       = muser.UserName;
     Odata.Rename       = muser.UserName;
     Odata.Userid       = muser.UserID;
     //Odata.AddUser = siteListDP.SelectedValue;//跟单员,此处记录对应ID
     //Odata.Internalrecords = siteListDP.SelectedItem.Text;//内部记录,此处用来存与主机的关联信息
     //添加订单,添加数据库购物车
     if (OCl.Add(Odata))
     {
         DataTable tempDT = OCl.GetOrderbyOrderNo(Odata.OrderNo);//获取刚插入的ID,这个需要改,应该插入时返回最新的ID
         if (tempDT != null & tempDT.Rows.Count > 0)
         {
             M_CartPro cartModel = new M_CartPro();
             cartModel.Orderlistid = Convert.ToInt32(tempDT.Rows[0]["ID"]);
             cartModel.Addtime     = DateTime.Now;
             //cartModel.EndTime = proBll.GetEndTime(proModel, Convert.ToInt32(TextBox1.Text));
             cartModel.ProID    = proModel.ID;
             cartModel.Proname  = proModel.Proname;
             cartModel.Username = muser.UserName;
             cartModel.Shijia   = proModel.ShiPrice;
             cartModel.Pronum   = Convert.ToInt32(TextBox1.Text);
             cartModel.AllMoney = Odata.Ordersamount;
             cartModel.type     = (int)M_OrderList.OrderEnum.IDC;
             bcart.Add(cartModel);
             Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功');", true);
             Response.Redirect("OtherOrder/IDCOrder.aspx?OrderType=7");
         }
         else
         {
             function.WriteErrMsg(Resources.L.目标订单 + ":" + Odata.OrderNo + Resources.L.存在 + "!!!");
         }
     }
 }
コード例 #2
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            //续费订单只生成订单,不生成商品与IDC信息
            //创建一张新订单,完毕后更新老订单时间
            M_OrderList orderMod = orderBll.SelModelByOrderNo(OrderNo);
            M_Order_IDC idcMod   = idcBll.SelModelByOrderNo(OrderNo);
            M_Product   proMod   = probll.GetproductByid(idcMod.ProID);
            M_UserInfo  mu       = buser.SelReturnModel(orderMod.Userid);

            if (mu.IsNull)
            {
                function.WriteErrMsg("订单未绑定用户[" + orderMod.Userid + "],或用户不存在");
            }
            //根据所选,生成新的ID充值订单
            DataRow     timeMod = idcBll.GetSelTime(proMod, IDCTime_DP.SelectedValue);
            M_OrderList newMod  = orderBll.NewOrder(mu, M_OrderList.OrderEnum.IDCRen);

            newMod.Ordersamount = Convert.ToDouble(timeMod["price"]);
            newMod.Promoter     = idcMod.ID;
            newMod.Ordermessage = idcBll.ToProInfoStr(timeMod);
            newMod.id           = orderBll.insert(newMod);

            buser.SetLoginState(mu);
            string url = "/PayOnline/Orderpay.aspx?OrderCode=" + newMod.OrderNo;

            function.Script(this, "window.open('" + url + "');");
            ////普通续费产生无用IDC订单,以用户身份续费,产生了新订单
            //switch (Request.Form["usertype"])
            //{
            //    case "1":

            //        break;
            //    case "0"://管理员
            //        OrderHelper.FinalStep(newMod);
            //        function.WriteSuccessMsg("续费成功");
            //        break;
            //    default:
            //        break;
            //}
        }
コード例 #3
0
        protected void Submit_Btn_Click(object sender, EventArgs e)
        {
            M_UserInfo mu      = buser.GetLogin();
            M_Product  proMod  = proBll.GetproductByid(ProID);
            DataRow    timeMod = idcBll.GetSelTime(proMod, IDCTime_DP.SelectedValue);
            //-----------------------------------
            M_OrderList Odata = orderBll.NewOrder(mu, M_OrderList.OrderEnum.IDC);

            Odata.Balance_price = DataConvert.CDouble(timeMod["price"]);//需付金额
            Odata.Ordersamount  = Odata.Balance_price;
            //-----------------------------
            M_Order_IDC idcMod = new M_Order_IDC();

            idcMod.OrderNo   = Odata.OrderNo;
            idcMod.ProID     = proMod.ID;
            idcMod.ProInfo   = idcBll.ToProInfoStr(timeMod);
            idcMod.Domain    = BindDomain_T.Text;
            idcMod.AdminName = "webmater@" + idcMod.Domain;
            idcMod.AdminPwd  = Pwd_T.Text;
            idcMod.Remind    = OPSys_DP.SelectedValue + "|" + ServerPos_DP.SelectedValue + "|" + Record_T.Text;
            idcMod.ID        = idcBll.Insert(idcMod);
            Odata.id         = orderBll.Adds(Odata);
            //-----------------------------
            M_CartPro cpMod = new M_CartPro();

            cpMod.Orderlistid = Odata.id;
            cpMod.ProID       = proMod.ID;
            cpMod.Pronum      = 1;
            cpMod.Proname     = proMod.Proname;
            cpMod.Username    = mu.UserName;
            cpMod.Shijia      = Convert.ToDouble(timeMod["price"]);
            cpMod.AllMoney    = Convert.ToDouble(timeMod["price"]);
            cpMod.code        = timeMod["time"].ToString();
            cartProBll.GetInsert(cpMod);
            //-----------------------------
            M_Payment payMod = payBll.CreateByOrder(Odata);

            payBll.Add(payMod);
            Response.Redirect("/PayOnline/Orderpay.aspx?PayNo=" + payMod.PayNo);
        }
コード例 #4
0
        //评论
        public void Comment()
        {
            M_UserInfo  mu        = buser.GetLogin();
            int         Mid       = DataConverter.CLng(Request.Form["mid"]);
            DataTable   dt        = ansBll.Sel("ID=" + Mid, "", null);
            M_AskCommon askcomMod = new M_AskCommon();

            askcomMod.AskID   = DataConverter.CLng(dt.Rows[0]["QueID"]);
            askcomMod.AswID   = Mid;
            askcomMod.UserID  = mu.UserID;
            askcomMod.Content = Request.Form["txtSupplyment"];
            askcomMod.AddTime = DateTime.Now;
            askcomMod.Type    = 1;
            if (askComBll.insert(askcomMod) == 1)
            {
                function.WriteSuccessMsg("评论成功", "SearchDetails?ID=" + Request["ID"]); return;
            }
            else
            {
                function.WriteErrMsg("评论失败", "SearchDetails?ID=" + Request["ID"]); return;
            }
        }
コード例 #5
0
        protected void FileUp_Btn_Click(object sender, EventArgs e)
        {
            M_UserInfo mu = buser.GetLogin();

            if (!FileUp_File.HasFile)
            {
                function.Script(this, "请指定一个上传文件"); return;
            }
            string ext = Path.GetExtension(FileUp_File.FileName).ToLower();
            //if (ext.Equals(".html") || ext.Equals(".html") || ext.Equals(".shtml")) { function.Script(this, "不允许上传html文件"); return; }

            string fname    = DataSecurity.MakeFileRndName() + ext;
            string dirPath  = SiteConfig.SiteOption.UploadDir + "UserUpload/" + mu.UserName + mu.UserID + "/";
            string savePath = SafeSC.SaveFile(dirPath, FileUp_File, fname);

            if (WaterModuleConfig.WaterConfig.IsUsed && SafeSC.IsImage(FileUp_File.FileName))
            {
                savePath = ImgHelper.AddWater(savePath);
            }
            function.Script(this, "ZLIfrField.UploadPic(\"" + savePath + "\",\"" + FieldName + "\");");
            LblMsg_L.Text = "文件上传成功";
        }
コード例 #6
0
        public void ProcessRequest(HttpContext context)
        {
            M_UserInfo mu = buser.GetLogin();

            retMod.retcode = M_APIResult.Failed;
            try
            {
                switch (Action)
                {
                case "signinit":
                {
                    retMod.result  = signBll.GetSignType(mu);
                    retMod.addon   = signBll.GetToDaySign(mu);
                    retMod.retcode = M_APIResult.Success;
                }
                break;

                case "signin":
                {
                    retMod.result  = signBll.SignIn(mu).ToString();
                    retMod.retcode = M_APIResult.Success;
                }
                break;

                case "signout":
                {
                    retMod.result  = signBll.SignOut(mu).ToString();
                    retMod.retcode = M_APIResult.Success;
                }
                break;

                default:
                    retMod.retmsg = "[" + Action + "]接口不存在";
                    break;
                }
            }
            catch (Exception ex) { retMod.retmsg = ex.Message; }
            RepToClient(retMod);
        }
コード例 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_Design_Album albumMod = albumBll.SelReturnModel(Mid);
         M_UserInfo     mu       = buser.GetSelect(albumMod.UserID);
         string         username = mu.UserName;
         appMod = appBll.SelModelByUid(mu.UserID, "wechat");
         if (appMod != null)
         {
             wxMod = wxBll.SelForOpenid(1, appMod.OpenID);
             if (wxMod != null)
             {
                 username = wxMod.Name;
             }
         }
         albumMod.AlbumName += "-来自[" + username + "]的动力逐浪微相册";
         string html = SafeSC.ReadFileStr("/design/album/tlps/" + albumMod.UseTlp + "/photo.html");
         html = html.Replace("\"{album}\"", JsonConvert.SerializeObject(albumMod));
         Response.Clear(); Response.Write(html); Response.End();
     }
 }
コード例 #8
0
ファイル: UserWithDraw.aspx.cs プロジェクト: zoomlacms/web047
    protected void ToPurse_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo mu    = buser.GetLogin(false);
        int        money = DataConvert.CLng(Money_T.Text);

        if (BeforeCheck(mu, money))
        {
            //完成币值转换,并计算分成
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.SIcon, "提现入余额");
            //buser.AddMoney(mu.UserID, money, M_UserExpHis.SType.Purse, "提现入余额");
            //AutoUnit(mu, money);
            ////生成提现记录,由后台管理员确认后再转入余额
            M_Cash cashMod = new M_Cash();
            cashMod.UserID  = mu.UserID;
            cashMod.money   = money;
            cashMod.YName   = mu.UserName;
            cashMod.Bank    = "余额";
            cashMod.Classes = 1;//余额提现
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("申请成功,请等待管理员审核");
        }
    }
コード例 #9
0
        private void GetMethod(M_Node nodeinfo, M_UserInfo mu)
        {
            if (nodeinfo.Purview != null && nodeinfo.Purview != "")
            {
                DataRow auitdr = nodeBll.GetNodeAuitDT(nodeinfo.Purview).Rows[0];

                string input_v = auitdr["input"].ToString();

                if (input_v != null && input_v != "")
                {
                    string tmparr = "," + input_v + ",";

                    switch (mu.Status)
                    {
                    case 0:    //已认证
                        if (tmparr.IndexOf("," + mu.GroupID.ToString() + ",") == -1)
                        {
                            if (tmparr.IndexOf(",-1,") == -1)
                            {
                                function.WriteErrMsg("很抱歉!您没有权限在该栏目下修改信息!");
                            }
                        }
                        break;

                    default:    //未认证
                        if (tmparr.IndexOf(",-2,") == -1)
                        {
                            function.WriteErrMsg("很抱歉!您没有权限在该栏目下修改信息!");
                        }
                        break;
                    }
                }
                else
                {
                    //为空
                    function.WriteErrMsg("很抱歉!您没有权限在该栏目下修改信息!");
                }
            }
        }
コード例 #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     mu = buser.GetLogin(false);
     if (!IsPostBack)
     {
         double maxMoney = GetMaxMoney();
         Money_L.Text = maxMoney.ToString("F2");
         Money_T.Text = maxMoney.ToString("F2");
         if (maxMoney < 1)
         {
             rd_tr.Visible = true; rd_div.InnerText = "没有可提现的余额";
         }
         else if (mu.Purse < 0)
         {
             rd_tr.Visible = true; rd_div.InnerText = "你的余额为负数,不可提现";
         }
         else
         {
             op_tr.Visible = true;
         }
     }
 }
コード例 #11
0
ファイル: cart.aspx.cs プロジェクト: zoomlacms/web043
        //单价
        public string GetMyPrice()
        {
            int        proID    = Convert.ToInt32(Eval("ProID"));
            double     linPrice = TempPrice = Convert.ToDouble(Eval("LinPrice"));
            M_UserInfo mu       = buser.GetLogin();
            M_Product  proMod   = proBll.GetproductByid(proID);

            //多区域价格
            //if (string.IsNullOrEmpty(Region))
            //{
            //    Region = buser.GetRegion(mu.UserID);
            //}
            //TempPrice = regionBll.GetRegionPrice(proID, linPrice, Region, mu.GroupID);
            //如果多区域价格未匹配,则匹配会员价
            if (TempPrice == linPrice || TempPrice <= 0)
            {
                TempPrice = proBll.P_GetByUserType(proMod, mu);
            }
            string html = "<i class='fa fa-rmb'></i><span id='price_" + Eval("ID") + "'>" + TempPrice.ToString("f2") + "</span>";

            return(html);
        }
コード例 #12
0
ファイル: MyContent.aspx.cs プロジェクト: zwt-zf/cms
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                buser.CheckIsLogin();
                this.LblSiteName.Text = SiteConfig.SiteInfo.SiteName;
                string uname = HttpContext.Current.Request.Cookies["UserState"]["LoginName"];
                this.UserInfo = buser.GetUserByName(uname);
                if (string.IsNullOrEmpty(base.Request.QueryString["NodeID"]))
                {
                    this.NodeID = 0;
                }
                else
                {
                    this.NodeID = DataConverter.CLng(base.Request.QueryString["NodeID"]);
                }
                this.flag = base.Request.QueryString["type"];
                if (this.NodeID != 0)
                {
                    M_Node nod = this.bNode.GetNode(this.NodeID);
                    this.lblNodeName.Text = nod.NodeName;
                    string   ModeIDList     = nod.ContentModel;
                    string[] ModelID        = ModeIDList.Split(',');
                    string   AddContentlink = "";

                    for (int i = 0; i < ModelID.Length; i++)
                    {
                        AddContentlink = AddContentlink + "<a href=\"AddContent.aspx?ModelID=" + ModelID[i] + "&NodeID=" + this.NodeID + "\">" + this.bmode.GetModelById(DataConverter.CLng(ModelID[i])).ModelName + "</a>&nbsp;|&nbsp;";
                    }
                    this.lblAddContent.Text = AddContentlink;
                }
                else
                {
                    this.lblNodeName.Text   = "全部节点";
                    this.lblAddContent.Text = "";
                }
                RepNodeBind();
            }
        }
コード例 #13
0
        //======================回答人操作
        //我的回答
        public IActionResult MyAnswerlist()
        {
            AskAuth();
            M_UserInfo mu   = buser.GetLogin();
            string     qids = ansBll.GetUserAnswerIDS(mu.UserID);

            if (string.IsNullOrEmpty(qids))
            {
                return(WriteErr("你没有对任何问题进行回答!请回答后在进行查看!", "/Ask/list")); return(Content(""));
            }
            PageSetting setting = askBll.SelPage(CPage, 10, new Com_Filter()
            {
                ids = qids
            });

            if (Request.IsAjaxRequest())
            {
                return(PartialView("MyAnswerlist_List", setting));
            }
            ViewBag.islogin = buser.CheckLogin();
            return(View(setting));
        }
コード例 #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ExHelper.CheckUserAuth("client");
     if (!IsPostBack)
     {
         if (Mid > 0)
         {
             M_UserInfo       mu    = buser.GetLogin();
             M_User_StoreUser suMod = suBll.SelReturnModel(Mid);
             if (suMod.StoreID != mu.SiteID)
             {
                 function.WriteErrMsg("该客户不可访问");
             }
             HoneyName.Text       = suMod.HoneyName;
             Mobile.Text          = suMod.Mobile;
             Sex_DP.SelectedValue = suMod.Sex;
             BirthDay.Text        = suMod.BirthDay;
             WXNo.Text            = suMod.WXNo;
             Remark.Text          = suMod.Remark;
         }
     }
 }
コード例 #15
0
        //正常, 未审核,离职
        public string GetStatus()
        {
            M_UserInfo mu     = buser.SelReturnModel(DataConverter.CLng(Eval("UserID")));
            int        status = mu.Status;
            string     result = "";

            switch (status)
            {
            case 0:
                result = "正常";
                break;

            case 1:
                result = "禁用";
                break;

            default:
                result = status + "状态码未知";
                break;
            }
            return(result);
        }
コード例 #16
0
 private void MyBind()
 {
     M_UserInfo mu = buser.GetLogin();
     {
         DataTable dt = mailBll.Sel(10, mu.UserID, 0, 1, "", "");
         Rece_RPT.DataSource = dt;
         Rece_RPT.DataBind();
         Rece_Empty.Visible = dt.Rows.Count < 1;
     }
     {
         DataTable dt = mailBll.Sel(10, mu.UserID, 1, 1, "", "");
         Send_RPT.DataSource = dt;
         Send_RPT.DataBind();
         Send_Empty.Visible = dt.Rows.Count < 1;
     }
     {
         DataTable dt = msgBll.SelMyMail(mu.UserID);
         SiteMail_RPT.DataSource = dt;
         SiteMail_RPT.DataBind();
         SiteMail_Empty.Visible = dt.Rows.Count < 1;
     }
 }
コード例 #17
0
ファイル: VIPUpgrade.aspx.cs プロジェクト: zoomlacms/web047
 protected void Page_Load(object sender, EventArgs e)
 {
     if (function.isAjax())
     {
         string action = Request.Form["action"];
         string value  = (Request.Form["value"] ?? "").Replace(" ", "");
         if ("UserIsExist".Equals(action))
         {
             Response.Write(CheckUserName(value));
             Response.Flush();
             Response.End();
         }
     }
     if (!IsPostBack)
     {
         M_UserInfo mu = buser.GetLogin(false);
         if (mu.RoomID > 0)
         {
             Response.Redirect("/User/Default1.aspx");
         }
     }
 }
コード例 #18
0
    //更新购物车中的AllMoney(实际购买总价),便于后期查看详情
    private double UpdateCartAllMoney(DataTable dt)
    {
        M_UserInfo mu       = buser.GetLogin();
        double     allmoney = 0;

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow   dr      = dt.Rows[i];
            M_Cart    cartMod = cartBll.GetCartByid(Convert.ToInt32(dr["ID"]));
            M_Product proMod  = proBll.GetproductByid(Convert.ToInt32(dr["Proid"]));
            //--附加币值计价
            //if (orderCom.HasPrice(proMod.LinPrice_Json))
            //{
            //    M_LinPrice priceMod = JsonConvert.DeserializeObject<M_LinPrice>(proMod.LinPrice_Json);
            //    priceMod.Purse = priceMod.Purse * cartMod.Pronum;
            //    priceMod.Sicon = priceMod.Sicon * cartMod.Pronum;
            //    priceMod.Point = priceMod.Point * cartMod.Pronum;
            //    dr["AllMoney_Json"] = JsonConvert.SerializeObject(priceMod);
            //    cartMod.AllMoney_Json = DataConvert.CStr(dr["AllMoney_Json"]);
            //}
            //根据商品价格类型,看使用  零售|批发|会员|会员组价格
            double price = proBll.P_GetByUserType(proMod, mu);
            //--多价格编号,则使用多价格编号的价钱,ProName(已在购物车页面更新)
            //proBll.GetPriceByCode(dr["code"], proMod.Wholesalesinfo, ref price);
            cartMod.AllMoney    = price * cartMod.Pronum;
            cartMod.AllIntegral = cartMod.AllMoney;
            //----计算折扣
            dr["AllMoney"]    = cartMod.AllMoney;
            dr["AllIntegral"] = cartMod.AllIntegral;
            if (proMod.Recommend > 0)
            {
                dr["AllMoney"]   = (cartMod.AllIntegral - (cartMod.AllIntegral * ((double)proMod.Recommend / 100)));
                cartMod.AllMoney = Convert.ToDouble(dr["AllMoney"]);
            }
            cartBll.UpdateByID(cartMod);
            allmoney += cartMod.AllMoney;
        }
        return(allmoney);
    }
コード例 #19
0
        protected void BatAdd_Btn_Click(object sender, EventArgs e)
        {
            M_Plat_Comp compMod = compBll.SelReturnModel(CompID);

            string[] ids = UserIDS_Hid.Value.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < ids.Length; i++)
            {
                int         uid   = DataConvert.CLng(ids[i]);
                M_User_Plat upMod = upBll.SelReturnModel(uid);
                if (upMod == null)
                {
                    M_UserInfo newmu = buser.SelReturnModel(uid);
                    upMod = upBll.NewUser(newmu, compMod);
                    upBll.Insert(upMod);
                }
                else
                {
                    upMod.CompID = CompID; upBll.UpdateByID(upMod);
                }
            }
            MyBind();
        }
コード例 #20
0
ファイル: Cart1.aspx.cs プロジェクト: zoomlacms/web047
    protected void Page_Load(object sender, EventArgs e)
    {
        M_UserInfo mu = GetLogin();

        if (!IsPostBack)
        {
            ProModel model = new ProModel()
            {
                ProID = DataConvert.CLng(Request["ID"]), Pronum = DataConvert.CLng(Request["Pronum"])
            };
            model.Pronum = model.Pronum < 1 ? 1 : model.Pronum;
            if (model.ProID > 0)//将商品加入购物车
            {
                M_Product proMod = proBll.GetproductByid(model.ProID);
                if (proMod == null || proMod.ID < 1)
                {
                    function.WriteErrMsg("商品不存在");
                }
                OrderCommon.ProductCheck(proMod);
                //-----------------检测完成加入购物车
                M_Cart cartMod = new M_Cart();
                cartMod.Cartid        = CartCookID;
                cartMod.StoreID       = proMod.UserShopID;
                cartMod.ProID         = model.ProID;
                cartMod.Pronum        = model.Pronum;
                cartMod.AllMoney_Json = proMod.LinPrice_Json;
                cartMod.userid        = mu.UserID;
                cartMod.Username      = mu.UserName;
                cartMod.Getip         = EnviorHelper.GetUserIP();
                cartMod.Addtime       = DateTime.Now;
                cartMod.FarePrice     = proMod.LinPrice.ToString();
                cartMod.Proname       = proMod.Proname;
                int id = cartBll.AddModel(cartMod);
                ImportExtField(id, Request.Form["ext_hid"]);//模型字段
                Response.Redirect(Request.Url.AbsolutePath + "?ProClass=" + proMod.ProClass + "&remark=" + Request["remark"] + "&appid=" + Request["appid"]);
            }
            MyBind();
        }
    }
コード例 #21
0
        public IActionResult PaymentInfo()
        {
            M_Payment payMod = payBll.SelReturnModel(Mid);

            if (payMod == null)
            {
                return(WriteErr("支付单不存在")); return(null);
            }

            M_OrderList orderMod = orderBll.SelModelByOrderNo(payMod.PaymentNum);
            M_UserInfo  mu       = buser.SelReturnModel(orderMod.Userid);
            M_PayPlat   platMod  = new M_PayPlat();

            if (payMod.Status == 3 && payMod.PayPlatID > 0)
            {
                platMod = platBll.SelReturnModel(payMod.PayPlatID);
            }
            ViewBag.platMod  = platMod;
            ViewBag.orderMod = orderMod;
            ViewBag.mu       = mu;
            return(View(payMod));
        }
コード例 #22
0
ファイル: B_Shop_MoneyRegular.cs プロジェクト: baixue001/IPS
        /// <summary>
        /// 用于订单支持后的回调页,根据充值金额对其赠送
        /// </summary>
        public void AddMoneyByMin(M_UserInfo mu, double money, string addon)
        {
            B_User buser = new B_User();
            M_Shop_MoneyRegular regularMod = SelModelByMin(money);

            if (regularMod != null)
            {
                string remind = regularMod.UserRemind + "," + addon;
                if (regularMod.Purse > 0)
                {
                    buser.AddMoney(mu.UserID, regularMod.Purse, M_UserExpHis.SType.Purse, remind);
                }
                if (regularMod.Sicon > 0)
                {
                    buser.AddMoney(mu.UserID, regularMod.Sicon, M_UserExpHis.SType.SIcon, remind);
                }
                if (regularMod.Point > 0)
                {
                    buser.AddMoney(mu.UserID, regularMod.Point, M_UserExpHis.SType.Point, remind);
                }
            }
        }
コード例 #23
0
        //单价
        public string GetMyPrice()
        {
            int        proID    = Convert.ToInt32(Eval("ProID"));
            double     linPrice = TempPrice = Convert.ToDouble(Eval("LinPrice"));
            M_UserInfo mu       = SnsHelper.GetLogin();
            M_Product  proMod   = proBll.GetproductByid(proID);

            //多区域价格
            //if (string.IsNullOrEmpty(Region))
            //{
            //    Region = buser.GetRegion(mu.UserID);
            //}
            //TempPrice = regionBll.GetRegionPrice(proID, linPrice, Region, mu.GroupID);
            //如果多区域价格未匹配,则匹配会员价
            if (TempPrice == linPrice || TempPrice <= 0)
            {
                TempPrice = proBll.P_GetByUserType(proMod, mu);
            }
            string html = "<i class='fa fa-rmb'></i><span id='price_" + Eval("ID") + "'>" + TempPrice.ToString("f2") + "</span>";

            //if (orderCom.HasPrice(Eval("LinPrice_Json")))
            //{
            //    string json = DataConvert.CStr(Eval("LinPrice_Json"));
            //    M_LinPrice priceMod = JsonConvert.DeserializeObject<M_LinPrice>(json);
            //    if (priceMod.Purse > 0)
            //    {
            //        html += "余额:<span id='price_purse_" + Eval("ID") + "'>" + priceMod.Purse.ToString("f2") + "</span>";
            //    }
            //    if (priceMod.Sicon > 0)
            //    {
            //        html += "|银币:<span id='price_sicon_" + Eval("ID") + "'>" + priceMod.Sicon.ToString("f0") + "</span>";
            //    }
            //    if (priceMod.Point > 0)
            //    {
            //        html += "|积分:<span id='price_point_" + Eval("ID") + "'>" + priceMod.Point.ToString("f0") + "</span>";
            //    }
            //}
            return(html);
        }
コード例 #24
0
    protected void SaveBtn_Click(object sender, EventArgs e)
    {
        M_UserInfo  mu       = buser.GetLogin();
        M_UserRecei model    = new M_UserRecei();
        bool        isupdate = false;

        if (Mid > 0)
        {
            model    = receBll.GetSelect(Mid, mu.UserID);
            isupdate = true;
        }
        model.UserID = mu.UserID;
        model.Email  = mu.Email;
        //model.Provinces = Request.Form["province_dp"] + "|" + Request.Form["city_dp"] + "|" + Request.Form["county_dp"];
        model.CityCode = Request.Form["province_dp"] + "|" + Request.Form["city_dp"] + "|" + Request.Form["county_dp"];
        //model.CityCode = province_dp.SelectedValue + " " + city_dp.ValueSelectedValue + " " + county_dp.SelectedValue;
        model.Provinces  = pro_hid.Value;
        model.Street     = Street_T.Text;
        model.Zipcode    = ZipCode_T.Text;
        model.ReceivName = ReceName_T.Text;
        model.MobileNum  = MobileNum_T.Text;
        model.phone      = Area_T.Text + "-" + Phone_T.Text;
        model.isDefault  = Def_chk.Checked ? 1 : 0;
        if (isupdate)
        {
            receBll.GetUpdate(model);
        }
        else
        {
            model.ID = receBll.GetInsert(model);
        }
        if (Def_chk.Checked)
        {
            receBll.SetDef(model.ID);
        }
        function.Script(Page, "ShowSave();");
        //function.WriteSuccessMsg("保存地址成功!","UserRecei1.aspx");
    }
コード例 #25
0
ファイル: ArriveList.aspx.cs プロジェクト: zoomlacms/web054
        protected void Page_Load(object sender, EventArgs e)
        {
            M_UserInfo mu       = buser.GetLogin();
            double     allmoney = DataConvert.CDouble(Request["allmoney"]);
            string     ids      = DataConvert.CStr(Request.QueryString["ids"]);
            //------用户有哪些未使用的优惠券
            DataTable avdt   = avBll.U_Sel(mu.UserID, -100, 1);
            DataTable cartdt = null;

            if (avdt.Rows.Count < 1)
            {
                arrive_empty_div.Visible = true; return;
            }
            else
            {
                arrive_div.Style.Add("display", "block");
                arrive_data_div.Visible = true;
                avdt.Columns.Add("enable", typeof(int)); //优惠券是否有效 1:有效
                avdt.Columns.Add("err", typeof(string)); //不能使用的原因
                cartdt = cartBll.SelByCartID(B_Cart.GetCartID(), mu.UserID, -100, ids);
            }
            //---------------------------------------Logical
            for (int i = 0; i < avdt.Rows.Count; i++)
            {
                DataRow         dr     = avdt.Rows[i];
                M_Arrive        avMod  = new M_Arrive().GetModelFromReader(dr);
                double          money  = allmoney;
                M_Arrive_Result retMod = avBll.U_CheckArrive(avMod, mu.UserID, cartdt, money);
                dr["enable"] = retMod.enabled ? 1 : 0;
                dr["err"]    = retMod.err;
            }
            avdt.DefaultView.RowFilter   = "enable='1'";
            Arrive_Active_RPT.DataSource = avdt.DefaultView.ToTable();
            Arrive_Active_RPT.DataBind();
            avdt.DefaultView.RowFilter    = "enable='0'";
            Arrive_Disable_RPT.DataSource = avdt.DefaultView.ToTable();
            Arrive_Disable_RPT.DataBind();
        }
コード例 #26
0
ファイル: note.aspx.cs プロジェクト: zoomlacms/web040
        private int SaveBy(string json, int status = 0)
        {
            M_UserInfo     mu     = buser.GetLogin();
            M_Pro_Step     model  = new M_Pro_Step();
            M_Plat_Content conMod = JsonConvert.DeserializeObject <M_Plat_Content>(json);

            if (conMod.id > 0)
            {
                model = stepBll.SelReturnModel(conMod.id);
            }
            model.Title  = conMod.title;
            model.topimg = conMod.topimg;
            //model.Inputer = mu.UserName;
            model.CUser   = mu.UserID;
            model.CUName  = mu.UserName;
            model.ZStatus = status;
            model.comlist = JsonConvert.SerializeObject(conMod.comlist);
            //model.OrderID = stepBll.GetOrderID(NodeID);
            //model.ProID = NodeID;
            model.mp3    = conMod.mp3;
            model.Partic = conMod.ParticIDS.Trim(',');
            model.EDate  = DataConverter.CDate(conMod.EDate);
            //-------------
            if (model.ID > 0)
            {
                stepBll.UpdateByID(model);
            }
            else
            {
                //M_ModelInfo modelMod = new B_Model().SelReturnModel(46);
                //model.ModelID = 46;
                //model.TableName = "ZL_C_yjmx";//"ZL_C_yjmx"
                //model.NodeID = NodeID;
                //model.GeneralID = conBll.AddContent(table, model);
                model.ID = stepBll.Insert(model);
            }
            return(model.ID);
        }
コード例 #27
0
ファイル: Default1.master.cs プロジェクト: zoomlacms/web047
 protected void Page_Init(object sender, EventArgs e)
 {
     if (buser.CheckLogin())
     {
         M_UserInfo mu = buser.GetLogin();
         if (mu == null || mu.IsNull || mu.UserID < 1)
         {
             Response.Redirect("/wxpromo.aspx?r=" + Request.RawUrl);
             //Response.Redirect("/User/Login.aspx");
         }
         else if (mu.Status != 0)
         {
             function.WriteErrMsg("你的帐户未通过验证或被锁定,请与网站管理员联系", "/User/Login.aspx");
         }
         uappMod = uappBll.SelModelByUid(mu.UserID, "wechat");
         if (uappMod != null)
         {
             M_WX_User wxuserMod1 = wxuserBll.SelForOpenid(1, uappMod.OpenID);
             M_WX_User wxuserMod2 = wxuserBll.SelForOpenid(2, uappMod.OpenID);
             if (wxuserMod1 != null)
             {
                 footer_div1.Visible = true;
             }
             if (wxuserMod2 != null)
             {
                 footer_div2.Visible = true;
             }
             if (wxuserMod1 == null && wxuserMod2 == null)
             {
                 footer_div1.Visible = true;
             }
         }
     }
     else
     {
         B_User.CheckIsLogged(Request.RawUrl);
     }
 }
コード例 #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            siteUrl = SiteConfig.SiteInfo.SiteUrl;
            if (siteUrl.Substring(siteUrl.Length - 1, 1) == "/")
            {
                siteUrl = siteUrl.Substring(0, siteUrl.Length - 1);
            }
            info = buser.GetLogin();

            UserNameLb.Text = info.UserName;
            //uName.Text = info.UserName;
            double        GradeVar = info.UserExp;
            M_PointGrounp pointmod = pointBll.SelectPintGroup((int)info.UserExp);
            if (string.IsNullOrEmpty(pointmod.GroupName))
            {
                UserLvLb.Text = "";
            }
            else
            {
                UserLvLb.Text = "[" + pointmod.GroupName + "]";
            }
            LvIcon_Li.Text = StringHelper.GetItemIcon(pointmod.ImgUrl);
            GroupPic gp    = new GroupPic();
            M_Uinfo  binfo = buser.GetUserBaseByuserid(info.UserID);
            //if (string.IsNullOrEmpty(binfo.Mobile))
            //    mobile_yan.Visible = true;
            UserAddressLb.Text  = binfo.Address;
            UserSignLb.Text     = binfo.Sign;
            UserRegTimeLb.Text  = info.RegTime.ToString();
            UserYeLb.Text       = info.Purse.ToString();
            UserJfLb.Text       = info.UserExp.ToString();
            UserJbLb.Text       = info.SilverCoin.ToString();
            imgUserPic.ImageUrl = getproimg(info.UserFace);
            MyBind();
        }
    }
コード例 #29
0
        public int AddMedal_U(int id, int sender)
        {
            if (CheckMedalDiff(id, sender))
            {
                return(-2);
            }                                             //不能重复颁发
            B_Guest_Bar     barbll  = new B_Guest_Bar();
            M_Guest_Bar     barmod  = barbll.SelReturnModel(id);
            M_GuestBookCate catemod = new B_GuestBookCate().SelReturnModel(barmod.CateID);
            int             medalid = 2;//吧主勋章

            //不是吧主扣除积分
            if (!catemod.IsBarOwner(sender))
            {
                if (barmod.CUser == sender)
                {
                    return(-3);
                }            //非吧主不能给自己颁发勋章
                medalid = 1; //网友勋章
                B_User     buser = new B_User();
                M_UserInfo mu    = buser.SelReturnModel(sender);
                if (mu.UserExp <= 0)
                {
                    return(-1);
                }                                  //用户积分不足
                buser.ChangeVirtualMoney(sender, new M_UserExpHis()
                {
                    score     = -1,
                    ScoreType = (int)M_UserExpHis.SType.Point,
                    detail    = string.Format("{0} {1}在版面:{2}发表勋章给:[{3}]的贴子,扣除{4}分", DateTime.Now, mu.UserName, catemod.CateName, barmod.Title, catemod.SendScore)
                });
            }
            Insert(new M_Guest_Medals()
            {
                UserID = barmod.CUser, BarID = id, MedalID = medalid, Sender = sender
            });
            return(medalid);
        }
コード例 #30
0
ファイル: IOController.cs プロジェクト: baixue001/IPS
        //上传base64图片
        public IActionResult Base64()
        {
            string     base64str  = Request.Form["base64"];//上传的base64字符串
            string     action     = Request.Form["action"];
            string     uploadPath = "";
            string     saveName   = function.GetRandomString(6) + ".jpg";
            string     result     = "";
            M_UserInfo mu         = buser.GetLogin();

            try
            {
                if (!mu.IsNull)
                {
                    uploadPath = ZLHelper.GetUploadDir_User(mu, "dai");
                }
                else if (adminMod != null)
                {
                    uploadPath = ZLHelper.GetUploadDir_Admin(adminMod, "dai");
                }
                else //Not Login
                {
                    uploadPath = ZLHelper.GetUploadDir_Anony("dai");
                }
                ImgHelper imghelper = new ImgHelper();
                imghelper.Base64ToImg(uploadPath + saveName, base64str);
                result = uploadPath + saveName;
                return(Content(result));
            }
            catch (Exception ex)
            {
                ZLLog.L(ZLEnum.Log.fileup, new M_Log()
                {
                    Source  = Request.RawUrl(),
                    Message = "上传失败|文件名:" + uploadPath + saveName + "|" + "原因:" + ex.Message
                });
                return(Content(Failed.ToString()));
            }
        }