コード例 #1
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                ClassID.DataSource     = ProductClassBLL.ReadNamedList();
                ClassID.DataTextField  = "Name";
                ClassID.DataValueField = "ID";
                ClassID.DataBind();
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text     = RequestHelper.GetQueryString <string>("Key");

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.IsSale       = (int)BoolType.True;
                productSearch.IsDelete     = 0;//未删除的
                productSearch.StandardType = (int)ProductStandardType.No;
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                BindControl(ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count), RecordList, MyPager);
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "Id";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text        = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text        = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text           = RequestHelper.GetQueryString <string>("Name");
                StorageAnalyse.Text = RequestHelper.GetQueryString <string>("StorageAnalyse");

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.IsSale         = (int)BoolType.True;
                productSearch.Name           = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId        = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId        = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.StorageAnalyse = RequestHelper.GetQueryString <int>("StorageAnalyse");
                List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(productList, RecordList, MyPager);
            }
        }
コード例 #3
0
 /// <summary>
 /// Creates a Brand object
 /// </summary>
 /// <param name="ID">The ID for the brand</param>
 /// <param name="szapp">The application name</param>
 /// <param name="szhost">Host name</param>
 /// <param name="szRoot">Root for the app (analogous to "~")</param>
 /// <param name="szlogo">URL to a logo image</param>
 /// <param name="szEmail">Email address from which mail is sent</param>
 /// <param name="szFacebook">Link to the facebook feed for this brand</param>
 /// <param name="szStyleSheet">Link to the stylesheet for this brand</param>
 /// <param name="szTwitter">Link to the twitter feed for this brand</param>
 public Brand(BrandID ID, string szapp, string szhost, string szRoot, string szlogo, string szStyleSheet, string szEmail, string szFacebook, string szTwitter, string szBlog) : this(ID)
 {
     BrandID      = ID;
     AppName      = szapp;
     HostName     = szhost;
     Root         = szRoot;
     LogoURL      = szlogo;
     EmailAddress = szEmail;
     FacebookFeed = szFacebook;
     TwitterFeed  = szTwitter;
     StyleSheet   = szStyleSheet;
     BlogAddress  = szBlog;
 }
コード例 #4
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);
                RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass();
                RegionID.ClassID    = "|1|27|607|";
                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text          = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                IsSpecial.Text    = RequestHelper.GetQueryString <string>("IsSpecial");
                IsNew.Text        = RequestHelper.GetQueryString <string>("IsNew");
                IsHot.Text        = RequestHelper.GetQueryString <string>("IsHot");
                IsTop.Text        = RequestHelper.GetQueryString <string>("IsTop");

                List <ProductInfo> productList   = new List <ProductInfo>();
                ProductSearchInfo  productSearch = new ProductSearchInfo();
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.IsSpecial    = RequestHelper.GetQueryString <int>("IsSpecial");
                productSearch.IsNew        = RequestHelper.GetQueryString <int>("IsNew");
                productSearch.IsHot        = RequestHelper.GetQueryString <int>("IsHot");
                productSearch.IsSale       = (int)BoolType.True;
                productSearch.IsTop        = RequestHelper.GetQueryString <int>("IsTop");
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete     = 0;//没有逻辑删除的商品
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                productList        = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);

                BindControl(productList, RecordList, MyPager);
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsSale", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "Id";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text         = RequestHelper.GetQueryString <string>("Name");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                UserName.Text     = RequestHelper.GetQueryString <string>("UserName");
                OrderNumber.Text  = RequestHelper.GetQueryString <string>("OrderNumber");

                ProductSearchInfo productSearch = new ProductSearchInfo();
                OrderSearchInfo   orderSearch   = new OrderSearchInfo();
                productSearch.IsSale      = (int)BoolType.True;
                productSearch.Name        = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId     = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId     = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.InProductId = RequestHelper.GetQueryString <string>("ProductID");
                orderSearch.StartAddDate  = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                orderSearch.EndAddDate    = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                orderSearch.UserName      = RequestHelper.GetQueryString <string>("UserName");
                orderSearch.OrderNumber   = RequestHelper.GetQueryString <string>("OrderNumber");
                BindControl(OrderDetailBLL.StatisticsSaleDetail(CurrentPage, PageSize, orderSearch, productSearch, ref Count), RecordList, MyPager);
            }
        }
コード例 #6
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text          = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");


                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.IsSale       = 2;//草稿
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete     = 0;//没有逻辑删除的商品
                PageSize = 10;
                List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(productList, RecordList, MyPager);
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.IsSale  = (int)BoolType.True;
                productSearch.Name    = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID");
                string productOrderType = RequestHelper.GetQueryString <string>("ProductOrderType");
                productOrderType = (productOrderType == string.Empty) ? "SellCount" : productOrderType;
                productSearch.ProductOrderType = productOrderType;
                ClassID.Text          = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text          = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text             = RequestHelper.GetQueryString <string>("Name");
                StartDate.Text        = RequestHelper.GetQueryString <string>("StartDate");
                EndDate.Text          = RequestHelper.GetQueryString <string>("EndDate");
                ProductOrderType.Text = productOrderType;
                DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate");
                DateTime endDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate"));
                BindControl(ProductBLL.StatisticsProductSale(CurrentPage, PageSize, productSearch, ref Count, startDate, endDate), RecordList, MyPager);
            }
        }
コード例 #8
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text       = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text       = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text           = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text  = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text    = RequestHelper.GetQueryString <string>("EndAddDate");
                IsSpecial.Text     = RequestHelper.GetQueryString <string>("IsSpecial");
                IsNew.Text         = RequestHelper.GetQueryString <string>("IsNew");
                IsHot.Text         = RequestHelper.GetQueryString <string>("IsHot");
                IsTop.Text         = RequestHelper.GetQueryString <string>("IsTop");
                ProductNumber.Text = RequestHelper.GetQueryString <string>("ProductNumber");

                #region 销量 价格
                decimal _LowerSalePrice  = RequestHelper.GetQueryString <decimal>("LowerSalePrice");
                decimal _UpperSalePrice  = RequestHelper.GetQueryString <decimal>("UpperSalePrice");
                int     _LowerOrderCount = RequestHelper.GetQueryString <int>("LowerOrderCount");
                int     _UpperOrderCount = RequestHelper.GetQueryString <int>("UpperOrderCount");
                if (_LowerSalePrice >= 0 && _UpperSalePrice >= 0)
                {
                    this.LowerSalePrice.Text = _LowerSalePrice < _UpperSalePrice?_LowerSalePrice.ToString() : _UpperSalePrice.ToString();

                    this.UpperSalePrice.Text = _LowerSalePrice < _UpperSalePrice?_UpperSalePrice.ToString() : _LowerSalePrice.ToString();
                }
                if (_LowerOrderCount >= 0 && _UpperOrderCount >= 0)
                {
                    this.LowerOrderCount.Text = _LowerOrderCount < _UpperOrderCount?_LowerOrderCount.ToString() : _UpperOrderCount.ToString();

                    this.UpperOrderCount.Text = _LowerOrderCount < _UpperOrderCount?_UpperOrderCount.ToString() : _LowerOrderCount.ToString();
                }
                #endregion

                List <ProductInfo> productList   = new List <ProductInfo>();
                ProductSearchInfo  productSearch = new ProductSearchInfo();
                //productSearch.Key = RequestHelper.GetQueryString<string>("Key");
                productSearch.Name          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ProductNumber = RequestHelper.GetQueryString <string>("ProductNumber");
                productSearch.ClassId       = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId       = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.IsSpecial     = RequestHelper.GetQueryString <int>("IsSpecial");
                productSearch.IsNew         = RequestHelper.GetQueryString <int>("IsNew");
                productSearch.IsHot         = RequestHelper.GetQueryString <int>("IsHot");
                productSearch.IsSale        = (int)BoolType.True;
                productSearch.IsTop         = RequestHelper.GetQueryString <int>("IsTop");
                productSearch.StartAddDate  = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate    = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete      = 0;//没有逻辑删除的商品
                if (_LowerSalePrice >= 0 && _UpperSalePrice >= 0)
                {
                    productSearch.LowerSalePrice = _LowerSalePrice < _UpperSalePrice ? _LowerSalePrice : _UpperSalePrice;
                    productSearch.UpperSalePrice = _LowerSalePrice < _UpperSalePrice ? _UpperSalePrice : _LowerSalePrice;
                }
                if (_LowerOrderCount >= 0 && _UpperOrderCount >= 0)
                {
                    productSearch.LowerOrderCount = _LowerOrderCount < _UpperOrderCount ? _LowerOrderCount : _UpperOrderCount;
                    productSearch.UpperOrderCount = _LowerOrderCount < _UpperOrderCount ? _UpperOrderCount : _LowerOrderCount;
                }
                string productOrderType = RequestHelper.GetQueryString <string>("ProductOrderType");
                if (!string.IsNullOrEmpty(productOrderType))
                {
                    productSearch.ProductOrderType = productOrderType;
                }
                string orderType = RequestHelper.GetQueryString <string>("OrderType");
                productSearch.OrderType = orderType == "Asc"? OrderType.Asc:OrderType.Desc;
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                productList        = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);

                BindControl(productList, RecordList, MyPager);


                switch (RequestHelper.GetQueryString <string>("ActionProduct"))
                {
                case "OffSaleProduct":
                    int Id = RequestHelper.GetQueryString <int>("ID");
                    if (Id > 0)
                    {
                        CheckAdminPower("OffSaleProduct", PowerCheckType.Single);
                        var product = ProductBLL.Read(Id);
                        if (product.IsSale == (int)BoolType.True)
                        {
                            product.IsSale = (int)BoolType.False;
                            ProductBLL.Update(product);
                            AdminLogBLL.Add(ShopLanguage.ReadLanguage("OffSaleRecord"), ShopLanguage.ReadLanguage("Product"), Id.ToString());
                            ScriptHelper.Alert(ShopLanguage.ReadLanguage("OffSaleOK"), Request.UrlReferrer.ToString());
                        }
                    }
                    break;

                case "DeleteProduct":
                    Id = RequestHelper.GetQueryString <int>("ID");
                    if (Id > 0)
                    {
                        CheckAdminPower("DeleteProduct", PowerCheckType.Single);

                        ProductBLL.DeleteLogically(Id);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Product"), Id.ToString());
                        ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), Request.UrlReferrer.ToString());
                    }
                    break;

                case "ModifyPrice":
                    ModifyPrice();
                    break;

                case "ModifyStorage":
                    ModifyStorage();
                    break;

                default:
                    break;
                }
            }
        }
コード例 #9
0
 public Brand(BrandID brandID)
 {
     BrandID = brandID;
     AppName = HostName = Root = LogoURL = EmailAddress = FacebookFeed = TwitterFeed = StyleSheet = BlogAddress = VideoRef = string.Empty;
 }
コード例 #10
0
        private void SavePRMSupplierItemMapEntity()
        {
            if (IsValid)
            {
                try
                {
                    IList <ListViewDataItem> list = lvPRMSupplierItemMap.Items;

                    if (list != null && list.Count > 0)
                    {
                        foreach (ListViewDataItem lvdi in list)
                        {
                            TextBox txtActualPriceValidation = (TextBox)lvdi.FindControl("txtActualPriceLV");
                            if (txtActualPriceValidation.Enabled)
                            {
                                Decimal ActualPrice, DiscountPercentage, Price;
                                Int64   ItemID, BrandID;

                                Label   lblItemIDLV             = (Label)lvdi.FindControl("txtItemIDLV");
                                Label   lblBrandIDLV            = (Label)lvdi.FindControl("lblBrandIDLV");
                                TextBox txtActualPriceLV        = (TextBox)lvdi.FindControl("txtActualPriceLV");
                                TextBox txtDiscountPercentageLV = (TextBox)lvdi.FindControl("txtDiscountPercentageLV");
                                TextBox txtPriceLV     = (TextBox)lvdi.FindControl("txtPriceLV");
                                TextBox txtEntryDateLV = (TextBox)lvdi.FindControl("txtEntryDateLV");

                                Int64.TryParse(lblItemIDLV.Text, out ItemID);
                                Int64.TryParse(lblBrandIDLV.Text, out BrandID);
                                Decimal.TryParse(txtActualPriceLV.Text.Trim(), out ActualPrice);
                                Decimal.TryParse(txtDiscountPercentageLV.Text.Trim(), out DiscountPercentage);

                                Decimal actualPrice, discountPercentages, price;

                                Decimal.TryParse(txtActualPriceLV.Text.Trim(), out actualPrice);
                                Decimal.TryParse(txtDiscountPercentageLV.Text.Trim(), out discountPercentages);

                                price = actualPrice - (actualPrice * (discountPercentages / 100));

                                String fe1 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_SupplierID, ddlSupplierID.SelectedValue.ToString(), SQLMatchType.Equal);
                                String fe2 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_ItemID, ItemID.ToString(), SQLMatchType.Equal);
                                String fe3 = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapEntity.FLD_NAME_BrandID, BrandID.ToString(), SQLMatchType.Equal);
                                String fe4 = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);
                                String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe4, SQLJoinType.AND, fe3);
                                IList <PRMSupplierItemMapEntity> SupplierItemMapList = FCCPRMSupplierItemMap.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                                if (SupplierItemMapList != null && SupplierItemMapList.Count > 0)
                                {
                                    PRMSupplierItemMapEntity pRMSupplierItemMapEntity = SupplierItemMapList[0];
                                    pRMSupplierItemMapEntity.ActualPrice        = ActualPrice;
                                    pRMSupplierItemMapEntity.DiscountPercentage = DiscountPercentage;
                                    pRMSupplierItemMapEntity.Price  = price;
                                    pRMSupplierItemMapEntity.ItemID = ItemID;
                                    if (txtEntryDateLV.Text.Trim().IsNotNullOrEmpty())
                                    {
                                        pRMSupplierItemMapEntity.EntryDate = MiscUtil.ParseToDateTime(txtEntryDateLV.Text);
                                    }

                                    FCCPRMSupplierItemMap.GetFacadeCreate().Update(pRMSupplierItemMapEntity, fe, DatabaseOperationType.Update, TransactionRequired.No);
                                }
                            }
                        }
                        MiscUtil.ShowMessage(lblMessage, "Vendor Item Map Information has been updated successfully.", false);
                    }
                    BindPRMSupplierItemMapList();
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
コード例 #11
0
        /// <summary>
        /// 提交经销商信息
        /// </summary>
        /// <param name="msg"></param>
        public void SubDealerInfo(out string msg)
        {
            msg = string.Empty;
            Entities.DealerInfo Model = new Entities.DealerInfo();
            Model.Name = MemberName;
            BitAuto.YanFa.Crm2009.Entities.QueryDMSMember query = new YanFa.Crm2009.Entities.QueryDMSMember();
            query.Name = Model.Name;
            int DMSCount = 0;
            //在提交时根据经销商名称判断会员编号是否存在
            DataTable dtMember = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMember(query, "", 1, 100000, out DMSCount);

            if (dtMember != null && dtMember.Rows.Count > 0)
            {
                Model.MemberCode = dtMember.Rows[0]["MemberCode"].ToString();
            }
            else
            {
                Model.MemberCode = "";
            }
            Model.Remark       = Remark;
            Model.CustID       = CustID;
            Model.Status       = 0;
            Model.CreateTime   = System.DateTime.Now;
            Model.CreateUserID = (int?)BLL.Util.GetLoginUserID();
            Model.CarType      = CarType;
            Model.CityScope    = CityScope;
            Model.MemberStatus = MemberStatus;
            Model.MemberType   = MemberType;
            try
            {
                //判断是否有已购车,未购车记录
                if (BLL.BuyCarInfo.Instance.IsExistsByCustID(Model.CustID))
                {
                    BLL.BuyCarInfo.Instance.Delete(Model.CustID);
                    //BLL.Util.InsertUserLog("删除客户id为" + Model.CustID + ",的已购车未购车。");
                }
                int DealerID = 0;
                //判断是否存在经销商信息
                if (BLL.DealerInfo.Instance.IsExistsByCustID(Model.CustID))
                {
                    DealerID = BLL.DealerInfo.Instance.Update(Model);
                    BLL.Util.InsertUserLog("更新客户id为" + Model.CustID + ",的经销商信息。");
                }
                else
                {
                    DealerID = BLL.DealerInfo.Instance.Insert(Model);
                    BLL.Util.InsertUserLog("插入客户id为" + Model.CustID + ",的经销商信息。");
                }
                BLL.DealerBrandInfo.Instance.Delete(Model.CustID);
                //BLL.Util.InsertUserLog("删除客户id为" + Model.CustID + ",的经销商品牌信息。");
                if (BrandID != string.Empty)
                {
                    string[] brandids = BrandID.Split(',');
                    if (brandids != null && brandids.Length > 0)
                    {
                        for (int i = 0; i < brandids.Length; i++)
                        {
                            DealerBrandInfo Brandmodel = new DealerBrandInfo();
                            Brandmodel.CustID   = CustID;
                            Brandmodel.DealerID = DealerID;
                            if (brandids[i] != "")
                            {
                                Brandmodel.BrandID = Convert.ToInt32(brandids[i]);
                            }
                            BLL.DealerBrandInfo.Instance.Insert(Brandmodel);
                        }
                        BLL.Util.InsertUserLog("插入客户id为" + Model.CustID + ",的经销商品牌信息。");
                    }
                }
                msg = "success";
            }
            catch (Exception ex)
            {
                msg = "经销商信息保存失败,失败原因:" + ex.Message.ToString();
            }
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text          = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");


                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete     = 1;//逻辑删除的商品
                //PageSize = 10;
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(productList, RecordList, MyPager);

                var pid = RequestHelper.GetQueryString <int>("ID");

                switch (RequestHelper.GetQueryString <string>("Action"))
                {
                case "Recover":
                    if (pid > 0)
                    {
                        ProductBLL.Recover(pid);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("RecoverRecord"), ShopLanguage.ReadLanguage("Product"), pid);
                        ScriptHelper.Alert(ShopLanguage.ReadLanguage("RecoverOK"), Request.UrlReferrer.ToString());
                    }
                    break;

                case "Delete":
                    if (pid > 0)
                    {
                        ProductBLL.Delete(pid);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecordCompletely"), ShopLanguage.ReadLanguage("Product"), pid);
                        ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteCompletelyOK"), Request.UrlReferrer.ToString());
                    }
                    break;

                default:
                    break;
                }
            }
        }
コード例 #13
0
ファイル: Branding.cs プロジェクト: xmas25/MyFlightbookWeb
 public Brand(BrandID brandID)
 {
     BrandID = brandID;
     AppName = HostName = Root = LogoHRef = EmailAddress = FacebookFeed = TwitterFeed = StyleSheet = BlogAddress = VideoRef = AWSBucket = AWSETSPipelineConfigKey = string.Empty;
 }
コード例 #14
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ProductBatchEdit", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                string action = RequestHelper.GetQueryString <string>("Action");
                switch (action)
                {
                case "UnionEdit":
                    UnionEdit();
                    break;

                case "search":
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.Name         = RequestHelper.GetQueryString <string>("Name");
                    productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                    productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                    productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                    productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                    productSearch.IsSale       = (int)BoolType.True;
                    ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                    BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                    Name.Text         = RequestHelper.GetQueryString <string>("Name");
                    StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                    EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                    BindControl(ProductBLL.SearchList(productSearch), RecordList);
                    break;

                default:
                    break;
                }

                userGradeList = UserGradeBLL.ReadList();
                foreach (UserGradeInfo userGrade in userGradeList)
                {
                    if (userGradeIDList == string.Empty)
                    {
                        userGradeIDList   = userGrade.Id.ToString();
                        userGradeNameList = userGrade.Name;
                    }
                    else
                    {
                        userGradeIDList   += "," + userGrade.Id.ToString();
                        userGradeNameList += "," + userGrade.Name;
                    }
                }
            }
        }
コード例 #15
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ProductBatchEdit", PowerCheckType.Single);

                string action = RequestHelper.GetQueryString <string>("Action");
                if (action == "SingleEdit")
                {
                    SingleEdit();
                }

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.Name         = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");;
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsSale       = (int)BoolType.True;
                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text         = RequestHelper.GetQueryString <string>("Name");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                productList       = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(MyPager);

                string strProductID = string.Empty;
                foreach (ProductInfo product in productList)
                {
                    if (strProductID == string.Empty)
                    {
                        strProductID = product.Id.ToString();
                    }
                    else
                    {
                        strProductID += "," + product.Id.ToString();
                    }
                }
                userGradeList = UserGradeBLL.ReadList();
                foreach (UserGradeInfo userGrade in userGradeList)
                {
                    if (userGradeIDList == string.Empty)
                    {
                        userGradeIDList   = userGrade.Id.ToString();
                        userGradeNameList = userGrade.Name;
                    }
                    else
                    {
                        userGradeIDList   += "," + userGrade.Id.ToString();
                        userGradeNameList += "," + userGrade.Name;
                    }
                }
            }
        }
コード例 #16
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindClassBrandAttributeClassStandardType();
                BrandID.Items.Insert(0, new ListItem("请选择", "0"));
                RelationBrandID.Items.Insert(0, new ListItem("请选择", "0"));
                AccessoryBrandID.Items.Insert(0, new ListItem("请选择", "0"));

                string classId = RequestHelper.GetQueryString <string>("classId");
                productID = RequestHelper.GetQueryString <int>("ID");
                _brandId  = RequestHelper.GetQueryString <int>("BrandId");
                //ProductClass.DataSource = ProductClassBLL.ReadUnlimitClassList();
                if (productID <= 0)             //添加商品
                {
                    DraftButton.Visible = true; //添加商品可保存草稿
                    if (string.IsNullOrEmpty(classId))
                    {
                        Response.Redirect("/admin/productaddinit.aspx");
                    }
                    else
                    {
                        LastClassID = ProductClassBLL.GetLastClassID(classId);
                        proTypeID   = ProductClassBLL.GetProductClassType(LastClassID);
                        ProductTypeInfo aci = ProductTypeBLL.Read(proTypeID);
                        if (aci.Id > 0)
                        {
                            string[] strArray = aci.BrandIds.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                            int[]    intArray;

                            intArray         = Array.ConvertAll <string, int>(strArray, s => int.Parse(s));
                            productBrandList = ProductBrandBLL.ReadList(intArray);
                        }

                        if (productBrandList.Count > 0)
                        {
                            BrandID.DataSource     = productBrandList;
                            BrandID.DataTextField  = "Name";
                            BrandID.DataValueField = "ID";
                            BrandID.DataBind();
                            BrandID.Items.Insert(0, new ListItem("请选择", "0"));
                            if (_brandId > 0)
                            {
                                BrandID.Text = _brandId.ToString();
                            }

                            RelationBrandID.DataSource     = productBrandList;
                            RelationBrandID.DataTextField  = "Name";
                            RelationBrandID.DataValueField = "ID";
                            RelationBrandID.DataBind();
                            RelationBrandID.Items.Insert(0, new ListItem("请选择", "0"));

                            AccessoryBrandID.DataSource     = productBrandList;
                            AccessoryBrandID.DataTextField  = "Name";
                            AccessoryBrandID.DataValueField = "ID";
                            AccessoryBrandID.DataBind();
                            AccessoryBrandID.Items.Insert(0, new ListItem("请选择", "0"));
                        }
                        //商品分类对应的属性列表
                        attributeList = ProductTypeAttributeBLL.ReadList(proTypeID);
                        //商品类型对应的规格列表
                        standardList = ProductTypeStandardBLL.ReadList(proTypeID);
                        //添加商品时自动查找所属分类的售后服务
                        Remark.Value = GetProductClassRemark(classId);
                    }
                }
                else//修改商品
                {
                    CheckAdminPower("ReadProduct", PowerCheckType.Single);
                    DraftButton.Visible = false;//修改商品不可保存草稿
                    ProductInfo product = ProductBLL.Read(productID);
                    pageProduct = product;
                    //如果修改了分类则标识isupdate
                    if (!string.IsNullOrEmpty(classId) && product.ClassId != classId)
                    {
                        isUpdate = 1;
                    }

                    YejiRatio.Text = product.YejiRatio;

                    Name.Text      = product.Name;
                    SellPoint.Text = product.SellPoint;
                    Name.Attributes.Add("style", "color:" + product.Color);
                    color              = product.Color;
                    FontStyle.Text     = product.FontStyle;
                    ProductNumber.Text = product.ProductNumber;
                    //ProductClass.ClassID = product.ClassId;
                    Keywords.Text          = product.Keywords;
                    MarketPrice.Text       = product.MarketPrice.ToString();
                    SendPoint.Text         = product.SendPoint.ToString();
                    Photo.Text             = product.Photo;
                    Summary.Text           = product.Summary;
                    Introduction.Value     = product.Introduction1;
                    Weight.Text            = product.Weight.ToString();
                    GroupPrice.Text        = product.GroupPrice.ToString();
                    GroupQuantity.Text     = product.GroupQuantity.ToString();
                    GroupPhoto.Text        = product.GroupPhoto;
                    VirtualOrderCount.Text = product.VirtualOrderCount.ToString();

                    if (Convert.ToBoolean(product.IsSpecial))
                    {
                        IsSpecial.Checked = true;
                    }
                    if (Convert.ToBoolean(product.IsNew))
                    {
                        IsNew.Checked = true;
                    }
                    if (Convert.ToBoolean(product.IsHot))
                    {
                        IsHot.Checked = true;
                    }
                    if (Convert.ToBoolean(product.IsSale))
                    {
                        IsSale.Checked = true;
                    }
                    else
                    {
                        IsSale.Checked = false;
                    }
                    if (Convert.ToBoolean(product.IsTop))
                    {
                        IsTop.Checked = true;
                    }
                    if (Convert.ToBoolean(product.AllowComment))
                    {
                        AllowComment.Checked = true;
                    }
                    else
                    {
                        AllowComment.Checked = false;
                    }
                    TotalStorageCount.Text = product.TotalStorageCount.ToString();

                    LastClassID    = ProductClassBLL.GetLastClassID(product.ClassId);
                    this.proTypeID = ProductClassBLL.GetProductClassType(LastClassID);
                    //商品分类对应的属性列表
                    //attributeList = ProductTypeAttributeBLL.JoinAttribute(ProductClassBLL.Read(ProductClassBLL.GetLastClassID(product.ClassId)).ProductTypeId, productID);
                    attributeList        = ProductTypeAttributeBLL.JoinAttribute(this.proTypeID, productID);
                    Repeater1.DataSource = attributeList;
                    Repeater1.DataBind();
                    //商品类型对应的规格列表
                    standardList       = ProductTypeStandardBLL.ReadList(this.proTypeID);
                    standardRecordList = ProductTypeStandardRecordBLL.ReadListByProduct(product.Id, product.StandardType);
                    if (product.StandardType == 1)
                    {
                        if (standardRecordList.Count > 0)
                        {
                            TotalStorageCount.ReadOnly = true;
                        }
                    }
                    if (string.IsNullOrEmpty(classId))
                    {
                        LastClassID = ProductClassBLL.GetLastClassID(product.ClassId);
                    }
                    else
                    {
                        LastClassID = ProductClassBLL.GetLastClassID(classId);
                    }
                    int             proTypeID = ProductClassBLL.GetProductClassType(LastClassID);
                    ProductTypeInfo aci       = ProductTypeBLL.Read(proTypeID);
                    if (aci.Id > 0)
                    {
                        string[] strArray = aci.BrandIds.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                        int[]    intArray;

                        intArray         = Array.ConvertAll <string, int>(strArray, s => int.Parse(s));
                        productBrandList = ProductBrandBLL.ReadList(intArray);
                    }

                    if (productBrandList.Count > 0)
                    {
                        BrandID.DataSource     = productBrandList;
                        BrandID.DataTextField  = "Name";
                        BrandID.DataValueField = "ID";
                        BrandID.DataBind();
                        BrandID.Items.Insert(0, new ListItem("请选择", "0"));

                        RelationBrandID.DataSource     = productBrandList;
                        RelationBrandID.DataTextField  = "Name";
                        RelationBrandID.DataValueField = "ID";
                        RelationBrandID.DataBind();
                        RelationBrandID.Items.Insert(0, new ListItem("请选择", "0"));

                        AccessoryBrandID.DataSource     = productBrandList;
                        AccessoryBrandID.DataTextField  = "Name";
                        AccessoryBrandID.DataValueField = "ID";
                        AccessoryBrandID.DataBind();
                        AccessoryBrandID.Items.Insert(0, new ListItem("请选择", "0"));
                    }
                    if (_brandId > 0)
                    {
                        BrandID.Text = _brandId.ToString();
                    }
                    else
                    {
                        BrandID.Text = product.BrandId.ToString();
                    }

                    sendCount    = product.SendCount;
                    OrderID.Text = product.OrderId.ToString();

                    SalePrice.Text            = product.SalePrice.ToString();
                    Units.Text                = product.Unit;
                    Introduction_Mobile.Value = product.Introduction1_Mobile;
                    Sub_Title.Text            = product.SubTitle;
                    LowerCount.Text           = product.LowerCount.ToString();

                    Remark.Value = product.Remark;

                    BindRelation(product);
                    productPhotoList = ProductPhotoBLL.ReadList(productID, 0);
                }
                //userGradeList = UserGradeBLL.JoinUserGrade(productID);
            }
        }
コード例 #17
0
ファイル: MDBrand.ascx.cs プロジェクト: sriramsoftware/FATERP
        protected void lvMDBrand_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 BrandID;

            Int64.TryParse(e.CommandArgument.ToString(), out BrandID);

            if (BrandID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _BrandID = BrandID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDBrandEntity.FLD_NAME_BrandID, BrandID.ToString(), SQLMatchType.Equal);

                        MDBrandEntity mDBrandEntity = new MDBrandEntity();


                        result = FCCMDBrand.GetFacadeCreate().Delete(mDBrandEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _BrandID       = 0;
                            _MDBrandEntity = new MDBrandEntity();
                            PrepareInitialView();
                            BindMDBrandList();

                            MiscUtil.ShowMessage(lblMessage, "Brand has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Brand.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }