コード例 #1
0
ファイル: StandardBomViewModel.cs プロジェクト: Osama91/CCWFM
        public void AddNewMainRow(bool checkLastRow)
        {
            if (AllowAdd != true)
            {
                MessageBox.Show(strings.AllowAddMsg);
                return;
            }
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (checkLastRow)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (!isvalid)
                {
                    return;
                }
            }

            var firstOrDefault = BrandList.FirstOrDefault();

            var newrow = new TblStandardBomHeaderViewModel();

            MainRowList.Insert(currentRowIndex + 1, newrow);
            SelectedMainRow = newrow;
            if (firstOrDefault != null)
            {
                newrow.Brand = firstOrDefault.Brand_Code;
            }
        }
コード例 #2
0
 private void ProductEditor_Load(object sender, EventArgs e)
 {
     brandsBindingSource.DataSource       = BrandList.GetBrandList();
     productTypesBindingSource.DataSource = ProductTypeList.GetProductTypeList();
     BindProductType();
     modelsBindingSource.DataSource = ModelList.GetModelList();
 }
コード例 #3
0
ファイル: AdminPage.cs プロジェクト: AhmedNabih/OnlineStore
        private void BRemoveBrand_Click(object sender, EventArgs e)
        {
            List <BrandRawData> removeList = new List <BrandRawData>();

            for (int i = 0; i < BrandList.Items.Count; i++)
            {
                if (BrandList.GetItemChecked(i))
                {
                    BrandRawData tempData = new BrandRawData();
                    tempData.RefactorString(BrandList.Items[i].ToString());
                    removeList.Add(tempData);
                }
            }

            for (int i = 0; i < removeList.Count; i++)
            {
                bool DONE = controller.RemoveBrand(removeList[i].ID);
                if (DONE)
                {
                    MessageBox.Show(removeList[i].ToString() + " Removed");
                }
                else
                {
                    MessageBox.Show(removeList[i].ToString() + " Remove Failed");
                }
            }

            BRefreshBrandList_Click(sender, e);
        }
コード例 #4
0
ファイル: StoresAccess.cs プロジェクト: cedar-s/pinpaida
        /// <summary>
        /// List转获
        /// </summary>
        /// <param name="data"></param>
        public static List <StoreSearchModel> ConvertList(List <Entity.Model.StoresModel> data)
        {
            var list = new List <StoreSearchModel>();

            if (data != null && data.Any())
            {
                list.AddRange(data.Select(x => new StoreSearchModel
                {
                    apptSchedulerInd = x.apptSchedulerInd,
                    brand            = x.brand,
                    brandName        = BrandList.GetName(x.brand),
                    Id           = x.Id,
                    MainImage    = x.mainImage,
                    MainImageAll = GetMainImage(x.mainImage, x.brand),
                    openTime     = x.openTime,
                    phoneNumber  = x.phoneNumber,
                    storeAddress = x.storeAddress,
                    storeBadges  = x.storeBadges,
                    StoreName    = x.storeName,
                    city         = x.city,
                    cityPy       = x.cityPy
                }));
            }
            return(list);
        }
コード例 #5
0
ファイル: list.aspx.cs プロジェクト: ooyuan/micro-emall
    protected void BrandBind()
    {
        List <WMGoodBrands> list = WMGoodBrands.GetList();

        BrandList.DataSource = list;
        BrandList.DataBind();
    }
コード例 #6
0
        private async Task OnRemoveBrand()
        {
            db.Brand.Remove(db.Brand.FirstOrDefault(x => x.IdBrand == SelectedBrand.IdBrand));
            await db.SaveChangesAsync();

            BrandList.Remove(BrandList.FirstOrDefault(x => x == SelectedBrand.Name));
            Brands.Remove(SelectedBrand);
        }
コード例 #7
0
 public BrandList GetBrands()
 {
     if (brandList == null)
     {
         brandList = BrandLoader.LoadBrands();
     }
     return(brandList);
 }
コード例 #8
0
 public MyProduct()
 {
     this.Basket    = new HashSet <Basket>();
     this.Sales     = new HashSet <Sales>();
     this.BrandList = new List <SelectListItem>();
     BrandList.Insert(0, new SelectListItem {
         Text = "Önce kategori seçilmelidir.", Value = ""
     });
 }
コード例 #9
0
ファイル: ProductLoader.cs プロジェクト: gvhung/SalesManager
        public static ProductList LoadProducts(ProductTypeList productTypeList, BrandList brandList)
        {
            if (productTypeList == null || brandList == null)
            {
                return(null);
            }
            ProductList productList = LoadProductList(productTypeList, brandList);

            return(productList);
        }
コード例 #10
0
        public void SyncWelfareBrand()
        {
            var interfaceName      = "syncwelFareBrand";
            var loggingSessionInfo = BaseService.GetLoggingSession();
            var brandService       = new BrandDetailBLL(loggingSessionInfo);

            var dsBrands = new DataSet();
            var brands   = new BrandList();

            brands.brandlist = new List <Brand>();

            //更新接口同步表
            var queryList = UpdateInterfaceTimestamp(interfaceName, loggingSessionInfo);

            if (queryList != null && queryList.Length > 0)
            {
                //存在,根据日期条件查询
                dsBrands = brandService.GetSynWelfareBrandList(queryList.FirstOrDefault().LatestTime.ToString());
            }
            else
            {
                //不存在,查询所有数据
                dsBrands = brandService.GetSynWelfareBrandList(string.Empty);
            }

            if (dsBrands != null && dsBrands.Tables.Count > 0 && dsBrands.Tables[0].Rows.Count > 0)
            {
                brands.brandlist = DataTableToObject.ConvertToList <Brand>(dsBrands.Tables[0]);
                var content = brands.ToJSON();

                //将描述字段Encode
                foreach (var item in brands.brandlist)
                {
                    item.branddesc = HttpUtility.UrlEncode(item.branddesc, Encoding.UTF8);
                    byte[] buff = Encoding.UTF8.GetBytes(item.branddesc);
                    item.branddesc = Convert.ToBase64String(buff);
                }

                //上传数据
                var result = UploadData(interfaceName, brands.ToJSON());

                //写入接口日志
                var logEntity = new ZInterfaceLogEntity()
                {
                    LogId         = Utils.NewGuid(),
                    InterfaceName = interfaceName,
                    Params        = content,
                    ResultCode    = result.code,
                    ResultDesc    = result.description
                };

                InsertInterfaceLog(logEntity, loggingSessionInfo);
            }
        }
コード例 #11
0
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (firstRender)
            {
                catalogItems = await CatalogItemListPaged.HandleAsync(50);

                catalogTypes = await TypeList.HandleAsync();

                catalogBrands = await BrandList.HandleAsync();

                CallRequestRefresh();
            }

            await base.OnAfterRenderAsync(firstRender);
        }
コード例 #12
0
        private void CarEditForm_Load(object sender, EventArgs e)
        {
            ProducingCountryList _prodList = ProducingCountryList.GetProducingCountryList();

            producingCountryListBindingSource.DataSource = _prodList;

            BrandList _brList = BrandList.GetBrandList();

            brandListBindingSource.DataSource = _brList;

            carInfoBindingSource.DataSource      = _newCar;
            carDriveListBindingSource.DataSource = null;
            _listCaDrive = CarDriveList.GetCarDrive(_newCar.CarID);
            carDriveListBindingSource.DataSource = _listCaDrive;
        }
コード例 #13
0
ファイル: BrandLoader.cs プロジェクト: gvhung/SalesManager
        public static BrandList LoadBrands()
        {
            DataTable dataTable = DBAccessor.QueryBrands();

            if (dataTable == null)
            {
                return(null);
            }
            BrandList brandList = new BrandList();

            foreach (DataRow dataRow in dataTable.Rows)
            {
                Brand brand = LoadBrand(dataRow);
                brandList.AddBrand(brand);
            }
            return(brandList);
        }
コード例 #14
0
        private async Task OnAddBrand()
        {
            if (Name != "" && Description != "" && ImageBrand != null)
            {
                var item = new BrandModel(Guid.NewGuid().ToString(), Name, Description, Logo, image.StringToImage(Logo));
                db.Brand.Add(item);
                await db.SaveChangesAsync();

                Brands.Add(item);
                BrandList.Add(item.Name);
                ClearBrandParameters();
            }
            else
            {
                MessageBox.Show("Неверные данные! Повторите попытку!");
            }
        }
コード例 #15
0
        public async Task Init()
        {
            IsBusy = true;

            if (BrandList.Count == 0)
            {
                var brandList = await _serviceBrands.Get <IEnumerable <Brand> >(null);

                foreach (var brand in brandList)
                {
                    BrandList.Add(brand);
                }
                BrandList.Insert(0, new Brand()
                {
                    Name = null
                });
            }

            if (SelectedBrand != null)
            {
                var request = new Model.Requests.Vehicle.VehicleSearchRequest()
                {
                    BrandId = SelectedBrand.Id
                };
                var list = await _serviceVehicles.Get <IEnumerable <Vehicle> >(request);

                VehicleList.Clear();
                foreach (var vehicle in list)
                {
                    VehicleList.Add(vehicle);
                }
            }
            else
            {
                var list = await _serviceVehicles.Get <IEnumerable <Vehicle> >(null);

                VehicleList.Clear();
                foreach (var vehicle in list)
                {
                    VehicleList.Add(vehicle);
                }
            }

            IsBusy = false;
        }
コード例 #16
0
ファイル: ProductLoader.cs プロジェクト: gvhung/SalesManager
        private static ProductList LoadProductList(ProductTypeList productTypeList, BrandList brandList)
        {
            DataTable dataTable = DBAccessor.QueryProducts();

            if (dataTable == null)
            {
                return(null);
            }
            ProductList productList = new ProductList();

            foreach (DataRow dataRow in dataTable.Rows)
            {
                Product product = LoadProduct(dataRow, productTypeList, brandList);
                if (product == null)
                {
                    continue;
                }
                productList.AddProduct(product);
            }
            return(productList);
        }
コード例 #17
0
        /// <summary>
        /// 新增按钮点击事件
        /// </summary>
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            //获取配置
            IList <UIPrintConfigModel> models      = this.PrintConfigDataGrid.ItemsSource as IList <UIPrintConfigModel>;
            UIPrintConfigModel         printConfig = new UIPrintConfigModel()
            {
                ComportList  = this.ComportList,
                IsUseList    = this.IsUseList,
                IsUse        = true,
                BaudrateList = this.BaudrateList,
                NotchList    = this.NotchList,
                Notch        = true,
                BrandList    = this.BrandList,
            };

            printConfig.Driver   = BrandList.First().Code.Split('@')[1];
            printConfig.ComPort  = (printConfig.ComportList != null && printConfig.ComportList.Count > 0) ? printConfig.ComportList.First().Name : string.Empty;
            printConfig.Baudrate = (printConfig.BaudrateList != null && printConfig.BaudrateList.Count > 0) ? printConfig.BaudrateList.First().Name : string.Empty;
            models.Add(printConfig);
            this.PrintConfigDataGrid.ItemsSource = models;
            this.PrintConfigDataGrid.Items.Refresh();
        }
コード例 #18
0
        private DateTime _lastTrade;                                 // 最後のトレードの日付

        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="name">システムの名前</param>
        /// <param name="timeFrame">タイムフレーム</param>
        /// <param name="brandList">使用する銘柄リスト</param>
        public Performance(string name, BrandList brandList, TimeFrame timeFrame)
        {
            _name                       = name;
            _brandList                  = brandList;
            _timeFrame                  = timeFrame;
            _consecutiveWin             = 0;
            _allTradesYear              = new Dictionary <int, float>();
            _totalProfitYear            = new Dictionary <int, float>();
            _totalWinTradesYear         = new Dictionary <int, float>();
            _allTradesMonth             = new Dictionary <int, float>();
            _totalProfitMonth           = new Dictionary <int, float>();
            _totalWinTradesMonth        = new Dictionary <int, float>();
            _totalMaxDrowDownYear       = new Dictionary <int, float>();
            _totalMaxBookDrowDownYear   = new Dictionary <int, float>();
            _totalMaxMarketDrowDownYear = new Dictionary <int, float>();
            _totalWinMaxProfitYear      = new Dictionary <int, float>();
            _totalLoseMaxProfitYear     = new Dictionary <int, float>();
            _maxBookDrowDawnDate        = new Dictionary <int, DateTime>();
            _maxMarketDrowDawnDate      = new Dictionary <int, DateTime>();
            _totalMaxDrowDownMonth      = new Dictionary <int, float>();
            _totalWinMaxProfitMonth     = new Dictionary <int, float>();
            _totalLoseMaxProfitMonth    = new Dictionary <int, float>();
        }
コード例 #19
0
        /// <summary>
        /// 获取店铺详情页面
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Detail(int id)
        {
            var model = StoresAccess.GetStoresDetail(id);

            ViewBag.store      = model;
            ViewBag.BrandModel = BrandList.GetModel(model.brand);
            ViewBag.brand      = ViewBag.BrandModel.Py;
            var request = new StoreSearchRequest
            {
                City     = model.city,
                Brand    = ViewBag.BrandModel.Py,
                PageSize = 4,
            };
            var list = new List <StoreSearchModel>();
            var data = StoresAccess.GetStoreList(request);

            if (data != null && data.Any())
            {
                data = data.Where(x => x.Id != id).Take(request.PageSize).ToList();
                list = StoresAccess.ConvertList(data);
            }
            ViewBag.List = list;
            return(View());
        }
コード例 #20
0
 public void generateBrandList()
 {
     if (BrandList != null)
     {
         BrandList.Clear();
     }
     for (int i = 0; i < All_edp.Count; i++)
     {
         String inputurl = ("http://afs-sl-pservice01.afservice.org:8080/productservice2/getProductInfo/pcmall?edplist=" + All_edp[i] + "&ignoreCatalog=true"); //  + 6926988/*EDP*/ +
         System.Xml.XmlTextReader reader = new XmlTextReader(inputurl);
         string brandx    = "";
         int    edp_tempo = 0;
         //   StringComparison comp = StringComparison.OrdinalIgnoreCase;
         while (reader.Read())
         {
             while (reader.ReadToFollowing("edp"))
             {
                 if (reader.Name == "edp")
                 {
                     edp_tempo = Convert.ToInt32(reader.ReadElementString("edp"));
                 }
                 if (reader.ReadToFollowing("manufacturer"))
                 {
                     brandx = reader.ReadElementString("manufacturer");
                 }
                 if (BrandList.Contains(brandx))
                 {
                 }
                 else
                 {
                     BrandList.Add(brandx);
                 }
             }
         }
     }
 }
コード例 #21
0
ファイル: ProductLoader.cs プロジェクト: gvhung/SalesManager
        private static Product LoadProduct(DataRow dataRow, ProductTypeList productTypeList, BrandList brandList)
        {
            int         id      = Convert.ToInt32(dataRow["PID"]);
            int         typeID  = Convert.ToInt32(dataRow["ProductType"]);
            int         brandID = Convert.ToInt32(dataRow["Brand"]);
            string      name    = dataRow["ProductName"].ToString();
            string      remark  = dataRow["Remark"].ToString();
            ProductType type    = productTypeList.GetType(typeID);

            if (type == null)
            {
                Log.Write("LoadProduct failed. Can't find type:" + typeID.ToString());
                return(null);
            }
            Brand brand = brandList.GetBrand(brandID);

            if (brand == null)
            {
                Log.Write("LoadProduct failed. Can't find brand:" + brandID.ToString());
                return(null);
            }
            Product result = new Product(id, type, name, brand, remark);

            return(result);
        }
コード例 #22
0
        /// <summary>
        /// 填充BrandList
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        public List <BrandList> SetBrand(DataSet ds, bool landing, bool staleDated)
        {
            ///获取网站ip
            string           web_url        = BaseConfiguration.SercerIp;
            long             InventoryShows = long.Parse(BaseConfiguration.InventoryShows);//页面商品库存最大显示数量
            List <BrandList> listMt         = new List <BrandList>();

            foreach (DataRow drMt in ds.Tables[0].Rows)
            {
                ///汇总信息
                BrandList mt = new BrandList();
                mt.EntId   = drMt["entid"].ToString();
                mt.BillNo  = drMt["billno"].ToString();
                mt.Name    = drMt["name"].ToString();
                mt.BeiZhu  = drMt["beizhu"].ToString();
                mt.Sort_Id = int.Parse(drMt["sort_id"].ToString());
                mt.Fabh    = drMt["fabh"].ToString();
                mt.Cxbs    = drMt["cxbs"].ToString();
                if (drMt["img_url"].ToString() != "")
                {
                    mt.ImgUrl = web_url + drMt["img_url"].ToString();
                }
                else
                {
                    mt.ImgUrl = "";
                }
                if (drMt["img_url_dt"].ToString() != "")
                {
                    mt.ImgUrlDt = web_url + drMt["img_url_dt"].ToString();
                }
                else
                {
                    mt.ImgUrlDt = "";
                }
                DataRow[] dr = ds.Tables[2].Select("billno='" + drMt["billno"].ToString() + "'", "sort_id asc,dj_sn asc");
                ///详情商品信息
                List <GoodsInfo> listDt = new List <GoodsInfo>();

                foreach (DataRow drDt in dr)
                {
                    GoodsInfo gi = new GoodsInfo
                    {
                        Article_Id     = drDt["article_id"].ToString(),
                        GoodsCode      = drDt["goodscode"].ToString(),
                        Sub_Title      = drDt["sub_title"].ToString(),
                        Drug_Spec      = drDt["drug_spec"].ToString(),
                        Package_Unit   = drDt["package_unit"].ToString(),
                        Drug_Factory   = drDt["drug_factory"].ToString(),
                        Big_Package    = BasisConfig.ObjToDecimal(drDt["big_package"].ToString(), BaseConfiguration.PackagePlace, 0.00M),
                        Stock_Quantity = BasisConfig.ObjToDecimal(drDt["stock_quantity"].ToString(), BaseConfiguration.InventoryPlace, 0.00M),
                        ApprovalNumber = drDt["approval_number"].ToString(),
                        ProposalPrice  = BasisConfig.ObjToDecimal(drDt["proposalPrice"].ToString(), BaseConfiguration.PricePlace, 0.00M),
                        Valdate        = drDt["valdate"].ToString(),
                        Scattered      = drDt["scattered"].ToString(),
                        Fabh           = drDt["fabh"].ToString(),
                        Cxbs           = drDt["cxbs"].ToString(),
                        GoodsLimit     = drDt["goodslimit"].ToString()
                    };
                    //大包装控制 Y-取大包装 N-不取大包装
                    string packControl = drDt["packControl"].ToString().Trim();
                    //中包装控制 Y-取中包装,不拆零 N-不取中包装,拆零
                    string scattered = drDt["scattered"].ToString().Trim();
                    if (packControl == "Y")
                    {
                        gi.Min_Package = BasisConfig.ObjToDecimal(drDt["big_package"].ToString(), BaseConfiguration.PackagePlace, 0.00M);
                    }
                    else
                    {
                        if (scattered == "Y")
                        {
                            gi.Min_Package = BasisConfig.ObjToDecimal(drDt["min_package"].ToString(), BaseConfiguration.PackagePlace, 0.00M);
                        }
                        else
                        {
                            gi.Min_Package = BasisConfig.ObjToDecimal(drDt["scatteredPackage"].ToString(), BaseConfiguration.PackagePlace, 0.00M);
                        }
                    }
                    //是否显示真实库存
                    if (InventoryShows > 0 && gi.Stock_Quantity > InventoryShows)
                    {
                        if (gi.Stock_Quantity >= 1000)
                        {
                            gi.Inventory = "充裕";
                        }
                        else
                        {
                            gi.Inventory = "紧张";
                        }
                    }
                    else
                    {
                        gi.Inventory = BasisConfig.ObjToDecimal(drDt["stock_quantity"].ToString(), BaseConfiguration.InventoryPlace, 0.00M).ToString();
                    }
                    //判断用户是否登陆
                    if (landing && !staleDated)
                    {
                        gi.Price = BasisConfig.ObjToDecimal(drDt["price"].ToString(), BaseConfiguration.PricePlace, 0.00M).ToString();
                        gi.Limit = drDt["limit"].ToString();
                    }
                    else
                    {
                        gi.Price = "会员可见";
                        gi.Limit = "Y";
                    }
                    if (drDt["img_url"].ToString() != "")
                    {
                        gi.ImgUrl = web_url + drDt["img_url"].ToString().Trim();
                    }
                    else
                    {
                        gi.ImgUrl = "";
                    }
                    listDt.Add(gi);
                }
                mt.GoodsList = listDt;
                listMt.Add(mt);
            }
            return(listMt);
        }
コード例 #23
0
        private void CarForm_Load(object sender, EventArgs e)
        {
            BrandList brandList = BrandList.GetBrandList();

            brandListBindingSource.DataSource = brandList;
        }
コード例 #24
0
 public BrandEditor(int brandId) : this()
 {
     _brand = BrandList.GetBrand(brandId);
 }
コード例 #25
0
        // Metodos

        // Metodo constructor de la clase ChatBot.
        // Entrada : Un numero entero que determina la personalidad del Chatbot.
        // Salida : Objeto ChatbotModel
        public ChatbotModel(int num)
        {
            Personality = num;
            brandList   = new List <string>();
            modelList   = new List <List <string> >();
            salute      = new List <String>();
            rates       = new List <int>();

            if (Personality == 0)
            {
                Salute.Add("Buenos Dias");
                Salute.Add("Buenas Tardes");
                Salute.Add("Buenas Noches");
                Name          = "Bienvenido al sistema de venta de autos, Cual es su nombre?";
                Help          = "En que le puedo ayudar?";
                SellCar       = "En este momento puedo vender estos autos: ";
                SellModel     = "Los modelos que tengo disponible son: ";
                Bye           = "Ha sido un gusto ayudarlo, espero que vuelva en otra ocasion.";
                NotUnderstand = "Disculpe, Lo puede decir de otra manera?";
                BrandList.Add("Ford");
                BrandList.Add("Toyota");
                BrandList.Add("Peugeot");
                List <String> aux1 = new List <String>();
                aux1.Add("Fiesta");
                aux1.Add("Mustang");
                aux1.Add("FordRaptor");
                List <String> aux2 = new List <String>();
                aux2.Add("Yaris");
                aux2.Add("Auris");
                aux2.Add("Corolla");
                List <String> aux3 = new List <String>();
                aux3.Add("301");
                aux3.Add("2008");
                aux3.Add("206");
                ModelList.Add(aux1);
                ModelList.Add(aux2);
                ModelList.Add(aux3);
            }

            if (Personality == 1)
            {
                Salute.Add("Bueno Dia");
                Salute.Add("Buenas Tardes");
                Salute.Add("Buenas Noches");
                Name          = "Bienvenido a la automotora, Dime tu nombre";
                Help          = "En que te ayudo?";
                SellCar       = "Estas marcas de autos tengo a la venta: ";
                SellModel     = "Estos modelos tengo a la venta:: ";
                Bye           = "Espero vuelvas.";
                NotUnderstand = "Lo puedes repetir?";
                BrandList.Add("Ford");
                BrandList.Add("Toyota");
                BrandList.Add("Peugeot");
                List <String> aux1 = new List <String>();
                aux1.Add("Fiesta");
                aux1.Add("Mustang");
                aux1.Add("FordRaptor");
                List <String> aux2 = new List <String>();
                aux2.Add("Yaris");
                aux2.Add("Auris");
                aux2.Add("Corolla");
                List <String> aux3 = new List <String>();
                aux3.Add("301");
                aux3.Add("2008");
                aux3.Add("206");
                ModelList.Add(aux1);
                ModelList.Add(aux2);
                ModelList.Add(aux3);
            }
        }
コード例 #26
0
        /// <summary>
        /// Returns true if BrandedFoodObjectItems instances are equal
        /// </summary>
        /// <param name="other">Instance of BrandedFoodObjectItems to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BrandedFoodObjectItems other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Barcode == other.Barcode ||
                     Barcode != null &&
                     Barcode.Equals(other.Barcode)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Brand == other.Brand ||
                     Brand != null &&
                     Brand.Equals(other.Brand)
                 ) &&
                 (
                     Ingredients == other.Ingredients ||
                     Ingredients != null &&
                     Ingredients.Equals(other.Ingredients)
                 ) &&
                 (
                     Package == other.Package ||
                     Package != null &&
                     Package.Equals(other.Package)
                 ) &&
                 (
                     Serving == other.Serving ||
                     Serving != null &&
                     Serving.Equals(other.Serving)
                 ) &&
                 (
                     Categories == other.Categories ||
                     Categories != null &&
                     Categories.SequenceEqual(other.Categories)
                 ) &&
                 (
                     Nutrients == other.Nutrients ||
                     Nutrients != null &&
                     Nutrients.SequenceEqual(other.Nutrients)
                 ) &&
                 (
                     DietLabels == other.DietLabels ||
                     DietLabels != null &&
                     DietLabels.Equals(other.DietLabels)
                 ) &&
                 (
                     DietFlags == other.DietFlags ||
                     DietFlags != null &&
                     DietFlags.SequenceEqual(other.DietFlags)
                 ) &&
                 (
                     PackagingPhotos == other.PackagingPhotos ||
                     PackagingPhotos != null &&
                     PackagingPhotos.Equals(other.PackagingPhotos)
                 ) &&
                 (
                     Allergens == other.Allergens ||
                     Allergens != null &&
                     Allergens.SequenceEqual(other.Allergens)
                 ) &&
                 (
                     BrandList == other.BrandList ||
                     BrandList != null &&
                     BrandList.SequenceEqual(other.BrandList)
                 ) &&
                 (
                     Countries == other.Countries ||
                     Countries != null &&
                     Countries.SequenceEqual(other.Countries)
                 ) &&
                 (
                     CountryDetails == other.CountryDetails ||
                     CountryDetails != null &&
                     CountryDetails.Equals(other.CountryDetails)
                 ) &&
                 (
                     PalmOilIngredients == other.PalmOilIngredients ||
                     PalmOilIngredients != null &&
                     PalmOilIngredients.SequenceEqual(other.PalmOilIngredients)
                 ) &&
                 (
                     IngredientList == other.IngredientList ||
                     IngredientList != null &&
                     IngredientList.SequenceEqual(other.IngredientList)
                 ) &&
                 (
                     HasEnglishIngredients == other.HasEnglishIngredients ||
                     HasEnglishIngredients != null &&
                     HasEnglishIngredients.Equals(other.HasEnglishIngredients)
                 ) &&
                 (
                     Minerals == other.Minerals ||
                     Minerals != null &&
                     Minerals.SequenceEqual(other.Minerals)
                 ) &&
                 (
                     Traces == other.Traces ||
                     Traces != null &&
                     Traces.SequenceEqual(other.Traces)
                 ) &&
                 (
                     Vitamins == other.Vitamins ||
                     Vitamins != null &&
                     Vitamins.SequenceEqual(other.Vitamins)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Keywords == other.Keywords ||
                     Keywords != null &&
                     Keywords.SequenceEqual(other.Keywords)
                 ));
        }
コード例 #27
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Barcode != null)
         {
             hashCode = hashCode * 59 + Barcode.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Brand != null)
         {
             hashCode = hashCode * 59 + Brand.GetHashCode();
         }
         if (Ingredients != null)
         {
             hashCode = hashCode * 59 + Ingredients.GetHashCode();
         }
         if (Package != null)
         {
             hashCode = hashCode * 59 + Package.GetHashCode();
         }
         if (Serving != null)
         {
             hashCode = hashCode * 59 + Serving.GetHashCode();
         }
         if (Categories != null)
         {
             hashCode = hashCode * 59 + Categories.GetHashCode();
         }
         if (Nutrients != null)
         {
             hashCode = hashCode * 59 + Nutrients.GetHashCode();
         }
         if (DietLabels != null)
         {
             hashCode = hashCode * 59 + DietLabels.GetHashCode();
         }
         if (DietFlags != null)
         {
             hashCode = hashCode * 59 + DietFlags.GetHashCode();
         }
         if (PackagingPhotos != null)
         {
             hashCode = hashCode * 59 + PackagingPhotos.GetHashCode();
         }
         if (Allergens != null)
         {
             hashCode = hashCode * 59 + Allergens.GetHashCode();
         }
         if (BrandList != null)
         {
             hashCode = hashCode * 59 + BrandList.GetHashCode();
         }
         if (Countries != null)
         {
             hashCode = hashCode * 59 + Countries.GetHashCode();
         }
         if (CountryDetails != null)
         {
             hashCode = hashCode * 59 + CountryDetails.GetHashCode();
         }
         if (PalmOilIngredients != null)
         {
             hashCode = hashCode * 59 + PalmOilIngredients.GetHashCode();
         }
         if (IngredientList != null)
         {
             hashCode = hashCode * 59 + IngredientList.GetHashCode();
         }
         if (HasEnglishIngredients != null)
         {
             hashCode = hashCode * 59 + HasEnglishIngredients.GetHashCode();
         }
         if (Minerals != null)
         {
             hashCode = hashCode * 59 + Minerals.GetHashCode();
         }
         if (Traces != null)
         {
             hashCode = hashCode * 59 + Traces.GetHashCode();
         }
         if (Vitamins != null)
         {
             hashCode = hashCode * 59 + Vitamins.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Keywords != null)
         {
             hashCode = hashCode * 59 + Keywords.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #28
0
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public async Task <HttpOperationResponse <BrandList> > GetAllBrandAsyncWithOperationResponseAsync(CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // Tracing
            bool   shouldTrace  = ServiceClientTracing.IsEnabled;
            string invocationId = null;

            if (shouldTrace)
            {
                invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary <string, object> tracingParameters = new Dictionary <string, object>();
                ServiceClientTracing.Enter(invocationId, this, "GetAllBrandAsyncAsync", tracingParameters);
            }

            // Construct URL
            string url = "";

            url = url + "/brands";
            string baseUrl = this.Client.BaseUri.AbsoluteUri;

            // Trim '/' character from the end of baseUrl and beginning of url.
            if (baseUrl[baseUrl.Length - 1] == '/')
            {
                baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
            }
            if (url[0] == '/')
            {
                url = url.Substring(1);
            }
            url = baseUrl + "/" + url;
            url = url.Replace(" ", "%20");

            // Create HTTP transport objects
            HttpRequestMessage httpRequest = new HttpRequestMessage();

            httpRequest.Method     = HttpMethod.Get;
            httpRequest.RequestUri = new Uri(url);

            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
            }

            // Send Request
            if (shouldTrace)
            {
                ServiceClientTracing.SendRequest(invocationId, httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);

            if (shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
            }
            HttpStatusCode statusCode = httpResponse.StatusCode;

            cancellationToken.ThrowIfCancellationRequested();
            string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

            if (statusCode != HttpStatusCode.OK)
            {
                HttpOperationException <object> ex = new HttpOperationException <object>();
                ex.Request  = httpRequest;
                ex.Response = httpResponse;
                ex.Body     = null;
                if (shouldTrace)
                {
                    ServiceClientTracing.Error(invocationId, ex);
                }
                throw ex;
            }

            // Create Result
            HttpOperationResponse <BrandList> result = new HttpOperationResponse <BrandList>();

            result.Request  = httpRequest;
            result.Response = httpResponse;

            // Deserialize Response
            if (statusCode == HttpStatusCode.OK)
            {
                BrandList resultModel = new BrandList();
                JToken    responseDoc = null;
                if (string.IsNullOrEmpty(responseContent) == false)
                {
                    responseDoc = JToken.Parse(responseContent);
                }
                if (responseDoc != null)
                {
                    resultModel.DeserializeJson(responseDoc);
                }
                result.Body = resultModel;
            }

            if (shouldTrace)
            {
                ServiceClientTracing.Exit(invocationId, result);
            }
            return(result);
        }
コード例 #29
0
ファイル: ProductCfgForm.cs プロジェクト: gvhung/SalesManager
 private void InitData()
 {
     brandList       = controller.GetBrands();
     productTypeList = controller.GetProductTypes();
     productList     = controller.GetProducts();
 }
コード例 #30
0
        protected void SubcategoryList_SelectedIndexChanged(object sender, EventArgs e)
        {
            String catid    = CategoryList.SelectedValue.ToString();
            String subcatid = SubcategoryList.SelectedValue.ToString();

            //Response.Write(catid);
            //Response.Write(subcatid);
            conn = new MySqlConnection(GetConnectionString());

            Specification1.Visible      = false;
            SpecificationRList1.Visible = false;

            Specification2.Visible      = false;
            SpecificationRList2.Visible = false;

            Specification3.Visible      = false;
            SpecificationRList3.Visible = false;

            Specification4.Visible      = false;
            SpecificationRList4.Visible = false;

            Specification5.Visible      = false;
            SpecificationRList5.Visible = false;

            Specification6.Visible      = false;
            SpecificationRList6.Visible = false;

            Specification7.Visible      = false;
            SpecificationRList7.Visible = false;
            try
            {
                conn.Open();
                String          query1 = "Select Product_ID,CONCAT(Company_Name,' ',Product_Name,' ',Sp4_Value,' ',Sp5_Value,' ',Sp6_Value,' ',Sp7_Value,' ',Sp8_Value,' MRP ',Retail_Price,' WP ',Wholesale_Price,' Stock ',Stock) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                MySqlCommand    comm   = new MySqlCommand(query1, conn);
                MySqlDataReader dr1    = comm.ExecuteReader();
                //ProductsList.ClearSelection();

                ProductsList.DataSource     = dr1;
                ProductsList.DataTextField  = "CONCAT(Company_Name,' ',Product_Name,' ',Sp4_Value,' ',Sp5_Value,' ',Sp6_Value,' ',Sp7_Value,' ',Sp8_Value,' MRP ',Retail_Price,' WP ',Wholesale_Price,' Stock ',Stock)";
                ProductsList.DataValueField = "Product_ID";
                ProductsList.DataBind();
                dr1.Close();

                comm.CommandText = "Select DISTINCT(Company_Name) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                MySqlDataReader dr2 = comm.ExecuteReader();
                BrandList.DataSource     = dr2;
                BrandList.DataTextField  = "Company_Name";
                BrandList.DataValueField = "Company_Name";
                BrandList.DataBind();
                dr2.Close();
                BrandList.Visible = true;
                Label4.Visible    = true;

                comm.CommandText = "Select Specification4,Specification5,Specification6,Specification7,Specification8,Specification9,Specification10 from Specifications where Category_ID='" + catid + "' and Subcategory_ID = '" + subcatid + "'";
                MySqlDataReader dr3   = comm.ExecuteReader();
                String[]        Specs = new String[7];
                dr3.Read();
                for (int i = 0; i < 7; i++)
                {
                    Specs[i] = dr3.GetValue(i).ToString();
                }

                dr3.Close();
                if (Specs[0] != "")
                {
                    Specification1.Text    = Specs[0];
                    Specification1.Visible = true;
                }
                if (Specs[1] != "")
                {
                    Specification2.Text    = Specs[1];
                    Specification2.Visible = true;
                }
                if (Specs[2] != "")
                {
                    Specification3.Text    = Specs[2];
                    Specification3.Visible = true;
                }

                if (Specs[3] != "")
                {
                    Specification4.Text    = Specs[3];
                    Specification4.Visible = true;
                }
                if (Specs[4] != "")
                {
                    Specification5.Text    = Specs[4];
                    Specification5.Visible = true;
                }

                if (Specs[5] != "")
                {
                    Specification6.Text    = Specs[5];
                    Specification6.Visible = true;
                }
                if (Specs[6] != "")
                {
                    Specification7.Text    = Specs[6];
                    Specification7.Visible = true;
                }



                if (Specification1.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp4_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();

                    SpecificationRList1.DataSource     = dr4;
                    SpecificationRList1.DataTextField  = "Sp4_Value";
                    SpecificationRList1.DataValueField = "Sp4_Value";
                    SpecificationRList1.DataBind();
                    SpecificationRList1.Visible = true;
                    dr4.Close();
                }

                if (Specification2.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp5_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();
                    SpecificationRList2.DataSource     = dr4;
                    SpecificationRList2.DataTextField  = "Sp5_Value";
                    SpecificationRList2.DataValueField = "Sp5_Value";
                    SpecificationRList2.DataBind();
                    SpecificationRList2.Visible = true;
                    dr4.Close();
                }


                if (Specification3.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp6_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();
                    SpecificationRList3.DataSource     = dr4;
                    SpecificationRList3.DataTextField  = "Sp6_Value";
                    SpecificationRList3.DataValueField = "Sp6_Value";
                    SpecificationRList3.DataBind();
                    SpecificationRList3.Visible = true;
                    dr4.Close();
                }


                if (Specification4.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp7_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();
                    SpecificationRList4.DataSource     = dr4;
                    SpecificationRList4.DataTextField  = "Sp7_Value";
                    SpecificationRList4.DataValueField = "Sp7_Value";
                    SpecificationRList4.DataBind();
                    SpecificationRList4.Visible = true;
                    dr4.Close();
                }

                if (Specification5.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp8_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();
                    SpecificationRList5.DataSource     = dr4;
                    SpecificationRList5.DataTextField  = "Sp8_Value";
                    SpecificationRList5.DataValueField = "Sp8_Value";
                    SpecificationRList5.DataBind();
                    SpecificationRList5.Visible = true;
                    dr4.Close();
                }

                if (Specification6.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp9_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();
                    SpecificationRList6.DataSource     = dr4;
                    SpecificationRList6.DataTextField  = "Sp9_Value";
                    SpecificationRList6.DataValueField = "Sp9_Value";
                    SpecificationRList6.DataBind();
                    SpecificationRList6.Visible = true;
                    dr4.Close();
                }

                if (Specification7.Visible)
                {
                    comm.CommandText = "Select DISTINCT(Sp10_Value) from Master_Products where Category_ID='" + catid + "' and Subcategory_ID='" + subcatid + "'";
                    MySqlDataReader dr4 = comm.ExecuteReader();
                    SpecificationRList7.DataSource     = dr4;
                    SpecificationRList7.DataTextField  = "Sp10_Value";
                    SpecificationRList7.DataValueField = "Sp10_Value";
                    SpecificationRList7.DataBind();
                    SpecificationRList7.Visible = true;
                    dr4.Close();
                }
            }
            catch (Exception ex)
            { Response.Write(ex.Message); }
            finally{
                conn.Close();
            }
            BrandList.Items.Insert(0, new ListItem("", "0"));
        }