示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_User.CheckIsLogged(Request.RawUrl);
     if (!IsPostBack)
     {
         M_UserInfo  mu       = buser.GetLogin();
         M_OrderList orderMod = orderBll.SelModelByOrderNo(OrderNo);
         M_Order_IDC idcMod   = idcBll.SelModelByOrderNo(orderMod.OrderNo);
         if (orderMod == null)
         {
             function.WriteErrMsg("订单不存在");
         }
         if (orderMod.Userid != mu.UserID)
         {
             function.WriteErrMsg("你无权对该订单续费");
         }
         if (idcMod == null)
         {
             function.WriteErrMsg("idc订单不存在");
         }
         M_Product proMod = proBll.GetproductByid(idcMod.ProID);
         if (proMod == null)
         {
             function.WriteErrMsg("需要续费的商品不存在");
         }
         OrderNo_L.Text = orderMod.OrderNo;
         Domain_L.Text  = idcMod.Domain;
         Proname_L.Text = proMod.Proname;
         ETime_L.Text   = idcMod.ETime.ToString("yyyy/MM/dd");
         DataTable timedt = idcBll.P_GetValid(proMod.IDCPrice);
         IDCTime_DP.DataSource = timedt;
         IDCTime_DP.DataBind();
     }
 }
示例#2
0
        public string getproimg(string proid)
        {
            int       pid = DataConverter.CLng(proid);
            M_Product pinfo = pll.GetproductByid(pid);
            string    restring, type;

            restring = "";
            type     = pinfo.Thumbnails;
            if (!string.IsNullOrEmpty(type))
            {
                type = type.ToLower();
            }
            if (!string.IsNullOrEmpty(type) && (type.IndexOf(".gif") > -1 || type.IndexOf(".jpg") > -1 || type.IndexOf(".png") > -1))
            {
                string delpath = SiteConfig.SiteOption.UploadDir.Replace("/", "") + "/";

                if (type.StartsWith("http://", true, CultureInfo.CurrentCulture) || type.StartsWith("/", true, CultureInfo.CurrentCulture) || type.StartsWith(delpath, true, CultureInfo.CurrentCulture))
                {
                    restring = "<img src=../../" + type + " width=60 height=45>";
                }
                else
                {
                    restring = "<img src=../../" + SiteConfig.SiteOption.UploadDir + "/" + type + " width=60 height=45>";
                }
            }
            else
            {
                restring = "<img src=../../UploadFiles/nopic.gif width=60 height=45>";
            }
            return(restring);
        }
        protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int pid = Convert.ToInt32(e.CommandArgument.ToString());

            switch (e.CommandName.ToLower())
            {
            case "restore":
                if (bll.UpDeleteByID(pid))
                {
                    function.WriteSuccessMsg("还原成功!");
                }
                else
                {
                    function.WriteSuccessMsg("还原失败!");
                }
                break;

            case "del1":
                bll.RealDeleteByID(pid, bll.GetproductByid(pid));
                bd.SelByProID(pid, 2);
                break;

            default:
                break;
            }
            DataBind();
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_UserInfo mu = buser.GetLogin();
         if (!mu.IsNull && mu.Status != 0)
         {
             function.WriteErrMsg("你的帐户未通过验证或被锁定");
         }
         int proid = DataConvert.CLng(Request["id"]);
         //int suitid = DataConvert.CLng(Request["suitid"]);
         int pronum = DataConvert.CLng(Request["pronum"], 1);
         int pclass = -1;//非-1则为添加了商品,需要跳转
         if (proid > 0)
         {
             M_Product proMod = proBll.GetproductByid(proid);
             if (proMod == null)
             {
                 function.WriteErrMsg("商品不存在");
             }
             AddToCart(mu, proMod, pronum);
             pclass = proMod.ProClass;
         }
         if (function.isAjax())
         {
             return;
         }                                 //ajax下不需要数据绑定与跳转
         if (pclass > -1)
         {
             Response.Redirect(Request.Url.AbsolutePath + "?ProClass=" + pclass); return;
         }
         MyBind();
     }
 }
示例#5
0
        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("商品不存在");
                    }
                    if (proMod.ProClass == (int)M_Product.ClassType.IDC)
                    {
                        Response.Redirect("/Cart/FillIDCInfo.aspx?proid=" + proMod.ID);
                    }
                    OrderCommon.ProductCheck(proMod);
                    #region 特选商品逻辑 [delete]
                    if (proMod.Largess == 1)
                    {
                        B_User_BindPro ubpBll = new B_User_BindPro();
                        M_User_BindPro ubpMod = null;
                        if (mu.IsNull)
                        {
                            return;
                        }
                        ubpMod = ubpBll.SelModelByUid(mu.UserID);
                        if (ubpMod == null || !ubpMod.ProIDS.Contains("," + proMod.ID + ","))
                        {
                            Response.Redirect(Request.Url.AbsolutePath + "?ProClass=" + proMod.ProClass); return;
                        }
                    }
                    #endregion
                    //-----------------检测完成加入购物车
                    M_Cart cartMod = new M_Cart();
                    cartMod.Cartid    = CartCookID;
                    cartMod.StoreID   = proMod.UserShopID;
                    cartMod.ProID     = model.ProID;
                    cartMod.Pronum    = model.Pronum;
                    cartMod.userid    = mu.UserID;
                    cartMod.Username  = mu.UserName;
                    cartMod.FarePrice = proMod.LinPrice.ToString();
                    cartMod.ProAttr   = DataConvert.CStr(Request["attr"]);
                    cartMod.Proname   = proMod.Proname;
                    int id = cartBll.AddModel(cartMod);
                    //ImportExtField(id, Request.Form["ext_hid"]);//模型字段
                    Response.Redirect(Request.Url.AbsolutePath + "?ProClass=" + proMod.ProClass);
                }
                MyBind();
            }
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     function.Script(this, "console.log('here11');");
     if (this.Page.IsValid)
     {
         M_Stock CData = new M_Stock();
         CData.id    = DataConverter.CLng(stockid.Value);
         CData.proid = DataConverter.CLng(productid.SelectedValue.ToString());
         string temptype = stocktyle.SelectedValue.ToString();
         if (temptype == "RK")
         {
             CData.stocktype = 0;
         }
         else
         {
             CData.stocktype = 1;
         }
         CData.proname = pll.GetproductByid(CData.proid).Proname;
         CData.danju   = stocktyle.Text + this.danjuhaobak.Value;
         // CData.adduser = this.adduser.Text;  //adminname
         CData.adduser = adduser.Text.Trim();
         CData.addtime = DataConverter.CDate(calendars.Text);
         CData.content = stockcontent.Text;
         CData.Pronum  = DataConverter.CLng(Pronum.Text);
         if (Button1.Text == "修改")
         {
             bll.EditStock(CData);
             function.WriteSuccessMsg("单据修改成功!请继续操作", "StockManage.aspx");
         }
         else
         {
             if (CData.stocktype != 0)
             {
                 M_Product proMod = pll.GetproductByid(PID);
                 if (proMod.Stock < CData.Pronum)
                 {
                     function.WriteErrMsg("商品数量不足,出库失败!");
                 }
             }
             bll.AddStock(CData);
             if (action.Equals("addpro"))
             {
                 var setNum = CData.stocktype == 0 ? CData.Pronum : -CData.Pronum;
                 function.Script(this, "parent.addStock(" + setNum + ");");
             }
             else
             {
                 function.WriteSuccessMsg("单据添加成功!请继续添加");
             }
         }
     }
 }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Product pll = new B_Product();
            int       id  = DataConverter.CLng(Request.QueryString["id"]);

            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ProductManage.aspx'>商城管理</a></li><li><a href='PresentProject.aspx'>促销方案管理</a></li><li>添加促销方案</li>");
            if (!IsPostBack)
            {
                if (id > 0)
                {
                    M_Promotions pinfo = bll.GetPromotionsByid(id);
                    this.HiddenID.Value       = id.ToString();
                    this.Promoname.Text       = pinfo.Promoname.ToString();
                    this.Promostart.Text      = pinfo.Promostart.ToString();
                    this.Promoend.Text        = pinfo.Promoend.ToString();
                    this.Pricetop.Text        = pinfo.Pricetop.ToString();
                    this.Priceend.Text        = pinfo.Priceend.ToString();
                    this.Integral.Text        = pinfo.Integral.ToString();
                    this.GetPresent.Checked   = (pinfo.GetPresent == 1) ? true : false;
                    this.Presentmoney.Text    = pinfo.Presentmoney.ToString();
                    this.IntegralTure.Checked = (pinfo.IntegralTure == 1) ? true : false;
                    if (!string.IsNullOrEmpty(pinfo.PromoProlist))
                    {
                        if (pinfo.PromoProlist.IndexOf(",") > -1)
                        {
                            string[] listarr = pinfo.PromoProlist.Split(new string[] { "," }, StringSplitOptions.None);
                            for (int i = 0; i < listarr.Length; i++)
                            {
                                string pronames = pll.GetproductByid(DataConverter.CLng(listarr[i])).Proname;
                                this.PromoProlist.Items.Add(new ListItem(pronames, listarr[i].ToString()));
                            }
                        }
                        else
                        {
                            string pronames = pll.GetproductByid(DataConverter.CLng(pinfo.PromoProlist)).Proname;
                            this.PromoProlist.Items.Add(new ListItem(pronames, pinfo.PromoProlist));
                        }
                    }

                    if (this.PromoProlist.Items.Count > 0)
                    {
                        for (int p = 0; p < this.PromoProlist.Items.Count; p++)
                        {
                            this.PromoProlist.Items[p].Selected = true;
                        }
                    }
                    //this.PromoProlist.Text = pinfo.PromoProlist.ToString();
                    this.Label1.Text = "修改促销方案";
                    this.Save_B.Text = "修改";
                }
            }
        }
示例#8
0
        protected string Getprotype(string proid)
        {
            int id = DataConverter.CLng(proid);

            if (pll.GetproductByid(id).Priority == 1 && pll.GetproductByid(id).Propeid > 0)
            {
                return("<font color=green>[绑]</font>");
            }
            else
            {
                return("");
            }
        }
        public string GetShopName(string studentname)
        {
            int       id    = DataConverter.CLng(studentname);
            M_Product muser = bp.GetproductByid(id);

            if (muser != null && muser.ID > 0)
            {
                return(muser.Proname);
            }
            else
            {
                return("");
            }
        }
示例#10
0
        private M_Product Stock_GetProByID(M_UserInfo mu, int ProID)
        {
            M_Product proMod = proBll.GetproductByid(ProID);

            if (proMod == null)
            {
                throw new Exception("商品不存在");
            }
            if (proMod.UserID != mu.UserID)
            {
                throw new Exception("你无权操作该商品库存");
            }
            return(proMod);
        }
示例#11
0
        private M_Product Stock_GetProByID(M_UserInfo mu, int ProID)
        {
            M_Product proMod = proBll.GetproductByid(ProID);

            if (proMod == null)
            {
                function.WriteErrMsg("商品不存在"); return(null);
            }
            if (proMod.UserID != mu.UserID)
            {
                function.WriteErrMsg("你无权操作该商品库存"); return(null);
            }
            return(proMod);
        }
示例#12
0
        public ActionResult AddProduct()
        {
            VM_Product vm = new VM_Product();

            if (Mid < 1)
            {
                if (ModelID < 1)
                {
                    function.WriteErrMsg("没有指定要添加内容的模型ID!"); return(null);
                }
                if (NodeID < 1)
                {
                    function.WriteErrMsg("没有指定要添加内容的栏目节点ID!"); return(null);
                }
                vm.proMod = new M_Product()
                {
                    Stock = 10, Rateset = 1, Dengji = 3
                };
                vm.NodeID         = NodeID;
                vm.ModelID        = ModelID;
                vm.proMod.ProCode = B_Product.GetProCode();
            }
            else
            {
                vm.proMod  = proBll.GetproductByid(Mid);
                vm.NodeID  = vm.proMod.Nodeid;
                vm.ModelID = vm.proMod.ModelID;
                vm.ValueDT = proBll.GetContent(vm.proMod.TableName, vm.proMod.ItemID);
                if (!string.IsNullOrEmpty(vm.proMod.BindIDS))//捆绑商品
                {
                    DataTable dt = proBll.SelByIDS(vm.proMod.BindIDS, "id,Thumbnails,Proname,LinPrice");
                    vm.bindList = JsonConvert.SerializeObject(dt);
                }
                #region 特选商品
                {
                    string where = string.Format("(ProIDS LIKE '%,{0},%' OR ProIDS LIKE '{0},%' OR ProIDS LIKE '%,{0}')", vm.proMod.ID.ToString());
                    DataTable dt   = DBCenter.SelWithField("ZL_User_BindPro", "UserID", where);
                    string    uids = StrHelper.GetIDSFromDT(dt, "UserID");
                    ViewBag.prouids = uids;
                }
                #endregion
            }
            //------------------------------------------------------------------------------------------------
            vm.nodeMod = nodeBll.SelReturnModel(vm.NodeID);
            if (vm.nodeMod.IsNull)
            {
                function.WriteErrMsg("节点[" + NodeID + "]不存在"); return(null);
            }
            return(View(vm));
        }
示例#13
0
    public string Gettypes(string id)
    {
        int sid  = DataConverter.CLng(id);
        int type = pro.GetproductByid(sid).Priority;

        if (type == 1)
        {
            return("<font color=green>[绑]</font>");
        }
        else
        {
            return("");
        }
    }
        //获取价格
        public string GetProPrice(string proclass, string type, string proid)
        {
            int       pid    = DataConverter.CLng(proid);
            M_Product proMod = proBll.GetproductByid(pid);

            switch (type)
            {
            case "1":
                return(proMod.ShiPrice.ToString("f2"));

            case "2":
            default:
                return(proMod.LinPrice.ToString("f2"));
            }
        }
示例#15
0
        public IActionResult Cart()
        {
            if (!mu.IsNull && mu.Status != 0)
            {
                return(WriteErr("你的帐户未通过验证或被锁定"));
            }
            int proid = DataConvert.CLng(GetParam("id"));

            if (proid < 1)
            {
                proid = DataConvert.CLng(GetParam("proid"));
            }
            //int suitid = DataConvert.CLng(GetParam("suitid"));
            int pronum = DataConvert.CLng(GetParam("pronum"), 1);
            int pclass = -1;//非-1则为添加了商品,需要跳转

            if (proid > 0)
            {
                M_Product proMod = proBll.GetproductByid(proid);
                if (proMod == null)
                {
                    return(WriteErr("商品不存在"));
                }
                AddToCart(mu, proMod, pronum);
                pclass = proMod.ProClass;
            }
            if (Request.IsAjaxRequest())
            {
                return(Content(Success.ToString()));
            }                                                                   //ajax下不需要数据绑定与跳转
            //通过页面访问
            if (pclass > -1)
            {
                Response.Redirect("Cart?ProClass=" + pclass);
            }
            B_Cart.UpdateUidByCartID(CartCookID, mu);
            VM_Cart model = new VM_Cart(HttpContext, mu);

            model.CartDT = cartBll.SelByCartID(CartCookID, mu.UserID, ProClass); //从数据库中获取
            if (StoreID != -100)                                                 //仅显示指定商铺的商品
            {
                model.CartDT.DefaultView.RowFilter = "StoreID=" + StoreID;
                model.CartDT = model.CartDT.DefaultView.ToTable();
            }
            model.StoreDT = orderCom.SelStoreDT(model.CartDT);
            //totalmoney.InnerText = TotalPrice.ToString("f2");
            return(View(model));
        }
示例#16
0
    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);
                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.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);
            }
            MyBind();
        }
    }
示例#17
0
        public IActionResult StoreContent()
        {
            if (ItemID < 1)
            {
                return(WriteErr("[产生错误的可能原因:您访问的商品信息不存在!"));
            }
            M_Product pinfo = proBll.GetproductByid(ItemID);

            if (pinfo == null)
            {
                return(WriteErr("[产生错误的可能原因:您访问的商品信息不存在!]"));
            }
            if (pinfo.UserShopID < 1)
            {
                Response.Redirect("/Shop/" + ItemID + "");
            }
            M_CommonData storeMod = conBll.Store_SelModel(pinfo.UserShopID);

            if (!StoreCheck(storeMod, ref err))
            {
                return(WriteErr(err));
            }
            M_Store_Style styleMod = styleBll.SelReturnModel(storeMod.DefaultSkins);

            if (styleMod == null || string.IsNullOrEmpty(styleMod.Template_Content))
            {
                return(WriteErr("尚未定义模板路径"));
            }
            string tlppath     = styleMod.Template_Content;
            string ContentHtml = SafeSC.ReadFileStr(SiteConfig.SiteOption.TemplateDir + "/" + tlppath);

            ContentHtml = bll.CreateHtml(ContentHtml, 0, ItemID, 0);
            return(HtmlToClient(ContentHtml));
        }
示例#18
0
        public void CopyToCartPro(M_OrderList Odata)
        {
            DataTable proDt = JsonConvert.DeserializeObject <DataTable>(Pro_Hid.Value);

            if (proDt == null)
            {
                return;
            }
            foreach (DataRow row in proDt.Rows)
            {
                M_CartPro cartMod = new M_CartPro();
                M_Product proMod  = proBll.GetproductByid(DataConvert.CLng(row["id"]));
                int       num     = DataConvert.CLng(row["pronum"]);
                cartMod.Orderlistid = Odata.id;
                cartMod.ProID       = proMod.ID;
                cartMod.Pronum      = num;
                cartMod.Proname     = proMod.Proname;
                cartMod.Username    = Odata.Reuser;
                cartMod.Shijia      = proMod.LinPrice;
                cartMod.AllMoney    = DataConvert.CDouble(Odata.Balance_price);
                cartMod.Danwei      = proMod.ProUnit;
                cartMod.Addtime     = DateTime.Now;
                cartMod.StoreID     = DataConvert.CLng(Odata.StoreID);
                cartProBll.GetInsert(cartMod);
            }
        }
示例#19
0
        protected void BatDel_Btn_Click(object sender, EventArgs e)
        {
            string CID = Request.Form["idchk"];//订单ID列表

            if (!String.IsNullOrEmpty(CID))
            {
                DataTable Ode     = orderBll.GetOrderbyOrderlist(CID);//获得订单列表
                int       odcount = Ode.Rows.Count;
                for (int p = 0; p < odcount; p++)
                {
                    int CartproOrderid = DataConverter.CLng(Ode.Rows[p]["id"]); //订单ID

                    //历遍清单所有商品数量,查找库存///////////////////
                    DataTable Unew = Cll.GetCartProOrderID(CartproOrderid); //获得详细清单列表

                    for (int s = 0; s < Unew.Rows.Count; s++)
                    {
                        int Onum = DataConverter.CLng(Unew.Rows[s]["Pronum"]);
                        int Opid = DataConverter.CLng(Unew.Rows[s]["ProID"]);

                        M_Product pdin = Pll.GetproductByid(Opid);//获得商品信息

                        if (pdin.JisuanFs == 1)
                        {
                            int pstock = pdin.Stock + Onum;//库存结果,返回的商品数量
                            Pll.ProUpStock(Opid, pstock);
                        }
                    }
                    //////////////////////////////////////////////////////
                }
                orderBll.Delorderlist(CID);
                function.WriteSuccessMsg("删除成功", "OrderList.aspx");
            }
        }
 private void PromoBind(string PromoProlist)
 {
     if (!string.IsNullOrEmpty(PromoProlist))
     {
         if (RadioButtonList1.SelectedValue == "1")
         {
             string[] listarr = PromoProlist.Split(',');
             for (int i = 0; i < listarr.Length; i++)
             {
                 M_Product proMod = pll.GetproductByid(DataConverter.CLng(listarr[i]));
                 Page.ClientScript.RegisterStartupScript(this.GetType(), i.ToString(), "SetPro('" + proMod.Proname + "','" + proMod.ID + "');", true);
             }
         }
         else
         {
             string[] listarr = PromoProlist.Split(new string[] { "," }, StringSplitOptions.None);
             for (int i = 0; i < listarr.Length; i++)
             {
                 M_Node nodeMod = bn.GetNodeXML(DataConverter.CLng(listarr[i]));
                 Page.ClientScript.RegisterStartupScript(this.GetType(), i.ToString(), "SetPro('" + nodeMod.NodeName + "','" + nodeMod.NodeID + "');", true);
             }
         }
     }
     Page.ClientScript.RegisterStartupScript(this.GetType(), "selall", "selall();", true);
 }
示例#21
0
        protected void Submit_B_Click(object sender, EventArgs e)
        {
            M_UserInfo mu = buser.SelReturnModel(DataConvert.CLng(UserID_Hid.Value));

            if (mu.IsNull)
            {
                function.WriteErrMsg("订单所绑定的用户[" + UserID_T.Text + "]不存在");
            }
            if (string.IsNullOrEmpty(ProID_Hid.Value) || string.IsNullOrEmpty(ProTime_Hid.Value))
            {
                function.WriteErrMsg("请先选择需要绑定的商品");
            }
            M_Product proMod = proBll.GetproductByid(Convert.ToInt32(ProID_Hid.Value));

            if (proMod == null)
            {
                function.WriteErrMsg("商品不存在");
            }
            DataRow timeMod = idcBll.GetSelTime(proMod, ProTime_Hid.Value);

            M_OrderList Odata = orderBll.NewOrder(mu, M_OrderList.OrderEnum.IDC);

            Odata.Ordermessage = Ordermessage_T.Text;//订货留言
            Odata.Ordersamount = DataConvert.CFloat(Price_T.Text);
            if (Odata.Ordersamount <= 0)
            {
                Odata.Ordersamount = Convert.ToDouble(timeMod["price"]);
            }
            Odata.Balance_price  = Odata.Ordersamount;
            Odata.Specifiedprice = Odata.Ordersamount;
            if (Odata.Ordersamount <= 0)
            {
                function.WriteErrMsg("未为商品指定价格");
            }
            Odata.id = orderBll.Adds(Odata);
            //-----------------------------
            M_Order_IDC idcMod = new M_Order_IDC();

            idcMod.ProID     = proMod.ID;
            idcMod.OrderNo   = Odata.OrderNo;
            idcMod.ProInfo   = idcBll.ToProInfoStr(timeMod);
            idcMod.Domain    = Domain_T.Text;
            idcMod.AdminName = "webmater@" + idcMod.Domain;
            idcMod.STime     = Convert.ToDateTime(STime_T.Text);
            idcMod.ETime     = idcMod.STime;
            idcMod.ID        = idcBll.Insert(idcMod);
            //-----------------------------
            DataTable prodt = new DataTable();

            prodt.Columns.Add(new DataColumn("proid", typeof(int)));
            prodt.Columns.Add(new DataColumn("pronum", typeof(int)));
            DataRow dr = prodt.NewRow();

            dr["proid"]  = proMod.ID;
            dr["pronum"] = 1;
            prodt.Rows.Add(dr);
            cartProBll.CopyToCartPro(mu, prodt, Odata.id);
            function.WriteSuccessMsg("订单添加成功!", "IDCOrder.aspx?OrderType=" + OrderType);
        }
示例#22
0
        /// <summary>
        /// 拷贝一份至ZL_CartPro长久保存
        /// </summary>
        public void CopyToCartPro(M_UserInfo mu, DataTable dt, int oid)
        {
            B_Product proBll = new B_Product();

            string[] fields = "Additional,StoreID,AllMoney_Json,code".Split(',');
            foreach (string field in fields)
            {
                if (!dt.Columns.Contains(field))
                {
                    dt.Columns.Add(new DataColumn(field, typeof(string)));
                }
            }
            foreach (DataRow dr in dt.Rows)
            {
                M_Product proMod = proBll.GetproductByid(Convert.ToInt32(dr["Proid"]));
                M_CartPro model  = new M_CartPro();
                model.Orderlistid = oid;
                model.ProID       = proMod.ID;
                model.Pronum      = DataConverter.CLng(dr["Pronum"]);
                model.Proname     = proMod.Proname;
                model.Shijia      = Convert.ToDouble(dr["FarePrice"]);
                model.Danwei      = proMod.ProUnit;
                model.Addtime     = DateTime.Now;
                model.StoreID     = DataConvert.CLng(dr["StoreID"]);
                model.code        = DataConvert.CStr(dr["code"]);
                model.Attribute   = DataConvert.CStr(dr["ProAttr"]);
                if (!dt.Columns.Contains("AllMoney"))
                {
                    model.AllMoney = proMod.LinPrice * model.Pronum;
                }
                else
                {
                    model.AllMoney = Convert.ToDouble(dr["AllMoney"]);
                }
                //model.Additional = DataConvert.CStr(dr["Additional"]);
                //model.AllMoney_Json = DataConvert.CStr(dr["AllMoney_Json"]);
                //如果非促销组合,则不保存商品简介和详情
                if (proMod.Class != 2)
                {
                    proMod.Procontent = ""; proMod.Proinfo = "";
                }
                //原价与优惠信息(便于展示)
                //model.Usepoint = 0;
                //model.UsePointArrive = 0;
                //model.FarePrice = "0";
                //model.ArriveMoney = 0;
                //model.ArriveRemind = "";
                #region 保存购买时用户的信息
                model.Username   = mu.UserName;
                model.Additional = DataConvert.CStr(dr["Additional"]);
                //model.Additional = JsonHelper.GetJson(new string[] { "UserID", "GroupID", "PUserID" }, new object[] { mu.UserID, mu.GroupID, mu.ParentUserID });
                #endregion
                #region 将整个商品信息备份(主要是价格和配置部分)
                model.PClass = proMod.Class.ToString();
                //model.ProInfo = JsonConvert.SerializeObject(backup);
                #endregion
                model.ID = cartProBll.GetInsert(model);
            }
        }
示例#23
0
    protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        M_UserInfo mu         = buser.GetLogin();
        M_Product  product    = new M_Product();
        M_Product  productPre = new M_Product();
        int        proID      = DataConverter.CLng(e.CommandArgument);

        switch (e.CommandName.ToLower())
        {
        case "upmove":
            product    = bll.GetproductByid(proID);
            productPre = bll.GetNearID(NodeID, product.OrderID, 1, mu.UserID);
            if (productPre.OrderID != 0)
            {
                int CurrOrder = product.OrderID;
                product.OrderID    = productPre.OrderID;
                productPre.OrderID = CurrOrder;
                bll.UpdateOrder(product);
                bll.UpdateOrder(productPre);
            }
            break;

        case "downmove":
            product    = bll.GetproductByid(proID);
            productPre = bll.GetNearID(NodeID, product.OrderID, 0, mu.UserID);
            if (productPre != null)
            {
                int CurrOrder = product.OrderID;
                product.OrderID    = productPre.OrderID;
                productPre.OrderID = CurrOrder;
                bll.UpdateOrder(product);
                bll.UpdateOrder(productPre);
            }
            break;

        case "del1":
            bll.DeleteByID(proID, bll.GetproductByid(proID));
            break;

        default:
            break;
        }
        MyBind();
    }
示例#24
0
        protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            M_Product product    = new M_Product();
            M_Product productPre = new M_Product();

            switch (e.CommandName.ToLower())
            {
            case "upmove":
                product    = bll.GetproductByid(Convert.ToInt32(e.CommandArgument.ToString()));
                productPre = bll.GetNearID(NodeID, product.OrderID, 1);               //int NodeID, int CurrentID, int UporDown
                if (productPre.OrderID != 0)
                {
                    int CurrOrder = product.OrderID;
                    product.OrderID    = productPre.OrderID;
                    productPre.OrderID = CurrOrder;
                    bll.UpdateOrder(product);
                    bll.UpdateOrder(productPre);
                }
                break;

            case "downmove":
                product    = bll.GetproductByid(Convert.ToInt32(e.CommandArgument.ToString()));
                productPre = bll.GetNearID(NodeID, product.OrderID, 0);
                if (productPre.ID != 0)
                {
                    int CurrOrder = product.OrderID;
                    product.OrderID    = productPre.OrderID;
                    productPre.OrderID = CurrOrder;
                    bll.UpdateOrder(product);
                    bll.UpdateOrder(productPre);
                }
                break;

            case "del1":
                int  pid   = DataConverter.CLng(e.CommandArgument.ToString());
                bool delok = bll.RealDelByIDS(pid.ToString());
                break;

            default:
                break;
            }
            MyBind();
        }
示例#25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_OrderList orderMod = orderBll.SelModelByOrderNo(OrderNo);
         M_Order_IDC idcMod   = idcBll.SelModelByOrderNo(orderMod.OrderNo);
         if (orderMod == null || idcMod == null)
         {
             function.WriteErrMsg("订单不存在或并非IDC订单");
         }
         M_Product proMod = probll.GetproductByid(idcMod.ProID);
         OrderNo_L.Text        = orderMod.OrderNo;
         ProName_L.Text        = proMod.Proname;
         IDCTime_DP.DataSource = idcBll.P_GetValid(proMod.IDCPrice);
         IDCTime_DP.DataBind();
         STime_L.Text = idcMod.STime.ToString("yyyy-MM-dd");
         ETime_L.Text = idcMod.ETime.ToString("yyyy-MM-dd");
         ETime_T.Text = idcMod.ETime.ToString("yyyy-MM-dd");
         Call.HideBread(Master);
     }
 }
示例#26
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.存在 + "!!!");
         }
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            int    NodeID = DataConverter.CLng(Request.Form["node_dp"]);
            string Ids    = this.TxtContentID.Text;

            string[] arrlist    = null;
            string   nodemodeid = nll.GetNodeXML(NodeID).ContentModel.ToString();
            string   pslist     = "";

            arrlist = Ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            if (arrlist != null && arrlist.Length > 0)
            {
                for (int i = 0; i < arrlist.Length; i++)
                {
                    int    pid   = DataConverter.CLng(arrlist[i]);
                    string modid = pll.GetproductByid(pid).ModelID.ToString();
                    if (("," + nodemodeid + ",").IndexOf("," + modid + ",") > -1)
                    {
                        M_Product pinfo = pll.GetproductByid(pid);
                        pinfo.Nodeid = DataConverter.CLng(NodeID);
                        pll.updateinfo(pinfo);
                        pslist = pslist + pinfo.ComModelID + ",";
                    }
                }
            }
            if (pslist.Length > 0)
            {
                string IIds = pslist.Substring(0, pslist.Length - 1);

                bool flag = this.bll.MoveContent(IIds, NodeID);
                if (flag)
                {
                    function.WriteSuccessMsg("商品移动成功", "../shop/ProductManage.aspx");
                }
            }
            else
            {
                function.WriteSuccessMsg("商品移动失败", "../shop/ProductManage.aspx");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     B_User.CheckIsLogged(Request.RawUrl);
     if (!IsPostBack)
     {
         M_Product proMod = proBll.GetproductByid(ProID);
         if (proMod == null)
         {
             function.WriteErrMsg("你尚未选定需要购买的商品");
         }
         DataTable idcDT = idcBll.P_GetValid(proMod.IDCPrice);
         if (idcDT == null || idcDT.Rows.Count < 1)
         {
             function.WriteErrMsg("未设置IDC商品价格");
         }
         IDCTime_DP.DataSource = idcDT;
         IDCTime_DP.DataBind();
         Proname_L.Text    = proMod.Proname;
         ProContent_L.Text = proMod.Procontent;
         Pwd_T.Attributes.Add("value", "123456");
         CPwd_T.Attributes.Add("value", "123456");
     }
 }
示例#29
0
 public void MyBind()
 {
     //DataTable dt = nodeBll.GetAllShopNode();
     //Node_L.Text = "<select id='node_dp' name='node_dp' class='form-control text_300'>" + nodeBll.CreateDP(dt) + "</select>";
     if (Mid > 0)
     {
         M_Product proMod = proBll.GetproductByid(Mid);
         if (proMod == null)
         {
             function.WriteErrMsg("商品[" + Mid + "]不存在");
         }
         Name_T.Text       = proMod.Proname;
         UProIDS_Hid.Value = proMod.Procontent;
         //ZStatus_Chk.Checked = proMod.Istrue == 1;
         Remind_T.Text = proMod.Proinfo;
         Price_T.Text  = proMod.LinPrice.ToString("F2");
         //BookPrice_T.Text = proMod.BookPrice.ToString("F2");
         //Stock.Text = proMod.Stock.ToString();
         SFileUp.FileUrl = proMod.Thumbnails;
         //function.Script(this, "setnode(" + proMod.Nodeid + ");");
         //function.Script(this, "SetChkVal('GuessXML','" + proMod.GuessXML + "');");
     }
 }
示例#30
0
        //确定购买
        protected void sureBtn_Click(object sender, EventArgs e)
        {
            M_UserInfo mu = buser.GetLogin();

            proModel = proBll.GetproductByid(Convert.ToInt32(dataField.Value));
            int num = Convert.ToInt32(proNum.Text.Trim());

            Odata.Ordersamount = Convert.ToDouble(num * proModel.LinPrice);
            Odata.OrderNo      = B_OrderList.CreateOrderNo(M_OrderList.OrderEnum.IDC);
            Odata.Ordertype    = (int)M_OrderList.OrderEnum.IDC;;//服务,主机等订单
            Odata.Receiver     = mu.UserName;
            Odata.Reuser       = mu.UserName;
            Odata.Userid       = mu.UserID;
            //Odata.AddUser = siteListDP.SelectedValue;//跟单员,此处记录对应ID
            //Odata.Internalrecords = siteListDP.SelectedItem.Text;//内部记录,此处用来存与主机的关联信息
            //添加订单,添加数据库购物车
            Odata.id = OCl.Adds(Odata);
            if (Odata.id > 0)
            {
                //写入购物车记录
                M_CartPro cartModel = new M_CartPro();
                cartModel.Orderlistid = Odata.id;
                cartModel.ProID       = proModel.ID;
                cartModel.Proname     = proModel.Proname;
                cartModel.Shijia      = proModel.LinPrice;
                cartModel.Pronum      = num;
                cartModel.AllMoney    = Odata.Ordersamount;
                cartModel.EndTime     = DateTime.Now;//支付时再更新日期, proBll.GetEndTime(proModel, num);
                cartModel.type        = (int)M_OrderList.OrderEnum.IDC;
                bcart.Add(cartModel);
                Response.Redirect("~/PayOnline/Orderpay.aspx?OrderCode=" + Odata.OrderNo);
            }
            else
            {
                function.WriteErrMsg("目标订单:" + Odata.OrderNo + "不存在!!!");
            }
        }