public SBInventoryBaseController() { _seasonFactory = new SeasonFactory(); _categoryFactory = new CategoriesFactory(); _printerFactory = new PrinterFactory(); _categoryFactoryInte = new InteCategoriesFactory(); }
static async Task Main(string[] args) { //Console.WriteLine("Que pais quieres"); //string pais = Console.ReadLine(); Season temporada = await SeasonFactory.GetSeasonAsync("mexico"); //CrearArchivoConTemporada nombre = new CrearArchivoConTemporada(); //nombre.mostrarResultados(temporada.Teams); //temporada.resultados(); SoccerTeam local = new SoccerTeam("Tigres UANL", 0); SoccerTeam visitant = new SoccerTeam("Club Tijuana", 0); GameLive gamelive = new GameLive(local, visitant); gamelive.updateGame += temporada.onUpdateGame; gamelive.VisitantScore(); gamelive.LocalScore(); gamelive.LocalScore(); gamelive.finishGame(); gamelive.VisitantScore(); //await temporada.ReadSeasonFromFile(); //temporada.resultados(); //Console.ReadKey(); }
public SeasonService(IActionHandler handler, ISeasonRepository seasonRepository, SeasonDTOMapper seasonMapper, SeasonFactory seasonFactory, ITelemetryEventService telemetry) : base(handler) { _seasonRepository = seasonRepository; _seasonMapper = seasonMapper; _seasonFactory = seasonFactory; _telemetry = telemetry; }
// GET: SBInventoryModifier public SBInventoryModifierInteController() { _factory = new InteProductFactory(); _seasonFactory = new SeasonFactory(); _categoryFactory = new CategoriesFactory(); _tipServiceChargeFactory = new TipServiceChargeFactory(); //ViewBag.ListStore = GetListStoreIntegration(); }
public async Task <IActionResult> TableOfSeason(String textNameUser, string country, string textYear) { Season temporada = await SeasonFactory.GetSeasonAsync(country); return(View("TableOfSeason", temporada.Teams)); }
public ProductModels GetDetail(string id) { try { ProductModels model = _factory.GetProductDetail(id); model.ImageURL = string.IsNullOrEmpty(model.ImageURL) ? Commons.Image100_100 : model.ImageURL; model.sServiceCharge = model.ServiceCharge == -1 ? "" : model.ServiceCharge.ToString(); //================Get Category CategoriesFactory categoryf = new CategoriesFactory(); //List<CategoriesModels> lstCg = categoryf.GetListCategory(model.StoreID, null, Commons.EProductType.Modifier.ToString("d"), CurrentUser.ListOrganizationId); //SelectListItem sslItemCag; //foreach (var category in lstCg) //{ // if (category.ListChild != null) // { // foreach (var item in category.ListChild) // { // sslItemCag = new SelectListItem(); // sslItemCag.Value = item.ID; // sslItemCag.Text = item.Name;// + " [" + item.StoreName + "]"; // sslItemCag.Selected = item.ID.Equals(model.CategoryID); // model.ListCategories.Add(sslItemCag); // } // } // else // { // sslItemCag = new SelectListItem(); // sslItemCag.Value = category.ID; // sslItemCag.Text = category.Name;// + " [" + category.StoreName + "]"; // sslItemCag.Selected = category.ID.Equals(model.CategoryID); // model.ListCategories.Add(sslItemCag); // } //} // Updated 08282017 List <SBInventoryBaseCateGroupViewModel> lstCateGroup = categoryf.GetListCategorySortParent(model.StoreID, null, Commons.EProductType.Modifier.ToString("d"), CurrentUser.ListOrganizationId, model.CategoryID); model.lstCateGroup = lstCateGroup; //================Price/Season SeasonFactory seasonf = new SeasonFactory(); List <SeasonModels> lstSs = seasonf.GetListSeason(model.StoreID, null, CurrentUser.ListOrganizationId); List <SelectListItem> lstSllItemSeason = new List <SelectListItem>(); SelectListItem sslItemSeason; foreach (var season in lstSs) { sslItemSeason = new SelectListItem(); sslItemSeason.Value = season.ID; sslItemSeason.Text = season.Name;// + " [" + season.StoreName + "]"; sslItemSeason.Selected = season.ID.Equals(model.SeasonPriceID); lstSllItemSeason.Add(sslItemSeason); } foreach (PriceItem priceItem in model.ListPrices) { priceItem.ListSeasons = lstSllItemSeason; } model.ListPrices[0].Price = model.DefaultPrice; model.ListPrices[1].Price = model.SeasonPrice == -1 ? 0 : model.SeasonPrice; model.ListPrices[1].SeasonID = model.SeasonPriceID; return(model); } catch (Exception ex) { _logger.Error("Product_Modifier_Detail: " + ex); return(null); } }
public ProductModels GetDetail(string id) { try { ProductModels model = _factory.GetProductDetail(id); if (model.ListGroup != null) { List <GroupProductModels> groupP = model.ListGroup; for (int i = 0; i < model.ListGroup.Count; i++) { model.ListGroup[i].OffSet = i; model.CurrencySymbol = CurrentUser.CurrencySymbol; if (model.ListGroup[i].ListProductOnGroup != null) { for (int j = 0; j < model.ListGroup[i].ListProductOnGroup.Count; j++) { model.ListGroup[i].ListProductOnGroup[j].OffSet = j; } } } } model.ImageURL = string.IsNullOrEmpty(model.ImageURL) ? Commons.Image100_100 : model.ImageURL; model.sServiceCharge = model.ServiceCharge == -1 ? "" : model.ServiceCharge.ToString(); //================Get Category CategoriesFactory categoryf = new CategoriesFactory(); //List<CategoriesModels> lstCg = categoryf.GetListCategory(model.StoreID, null, Commons.EProductType.SetMenu.ToString("d"), CurrentUser.ListOrganizationId); //SelectListItem sslItemCag = new SelectListItem(); //foreach (var category in lstCg) //{ // if (category.ListChild != null) // { // foreach (var item in category.ListChild) // { // sslItemCag = new SelectListItem(); // sslItemCag.Value = item.ID; // sslItemCag.Text = item.Name;// + " [" + item.StoreName + "]"; // sslItemCag.Selected = item.ID.Equals(model.CategoryID); // model.ListCategories.Add(sslItemCag); // } // } // else // { // sslItemCag = new SelectListItem(); // sslItemCag.Value = category.ID; // sslItemCag.Text = category.Name;//+ " [" + category.StoreName + "]"; // sslItemCag.Selected = category.ID.Equals(model.CategoryID); // model.ListCategories.Add(sslItemCag); // } //} // Updated 08282017 List <SBInventoryBaseCateGroupViewModel> lstCateGroup = categoryf.GetListCategorySortParent(model.StoreID, null, Commons.EProductType.SetMenu.ToString("d"), CurrentUser.ListOrganizationId, model.CategoryID); model.lstCateGroup = lstCateGroup; //=======TImeSlot model.ListSeason = GetListTimeSlot02(model.StoreID, model.ListProductSeason); if (model.ListProductSeason != null && model.ListProductSeason.Count != 0) { model.ProductSeason = string.Join(",", model.ListProductSeason.Select(x => x.SeasonName).ToList()); } else if (model.ListProductSeason.Count == 0) { model.ProductSeason = "All"; } //================Price SeasonFactory seasonf = new SeasonFactory(); List <SeasonModels> lstSs = seasonf.GetListSeason(model.StoreID, null, CurrentUser.ListOrganizationId); List <SelectListItem> lstSllItemSeason = new List <SelectListItem>(); SelectListItem sslItemSeason; foreach (var season in lstSs) { sslItemSeason = new SelectListItem(); sslItemSeason.Value = season.ID; sslItemSeason.Text = season.Name;// + " [" + season.StoreName + "]"; sslItemSeason.Selected = season.ID.Equals(model.SeasonPriceID); lstSllItemSeason.Add(sslItemSeason); } foreach (PriceItem priceItem in model.ListPrices) { priceItem.ListSeasons = lstSllItemSeason; } model.ListPrices[0].Price = model.DefaultPrice; model.ListPrices[1].Price = model.SeasonPrice == -1 ? 0 : model.SeasonPrice; model.ListPrices[1].SeasonID = model.SeasonPriceID; return(model); } catch (Exception ex) { _logger.Error("Product_SetMenu_Detail: " + ex); return(null); } }
public SSeasonController() { _factory = new SeasonFactory(); ViewBag.ListStore = GetListStore(); }
/*POnS*/ public ActionResult AddMoreProductItemOnStore(int currentOffset, string StoreID, string StoreName) { InteProductItemOnStore model = new InteProductItemOnStore(); InteProductPriceModels PriceOnStore = new InteProductPriceModels(); model.OffSet = currentOffset; model.StoreName = StoreName; model.StoreID = StoreID; model.CurrencySymbol = CurrentUser.CurrencySymbol; //================Price SeasonFactory seasonf = new SeasonFactory(); List <SeasonModels> lstSs = seasonf.GetListSeason(model.StoreID, null, CurrentUser.ListOrganizationId); List <SelectListItem> lstSllItemSeason = new List <SelectListItem>(); SelectListItem sslItemSeason; foreach (var season in lstSs) { sslItemSeason = new SelectListItem(); sslItemSeason.Value = season.ID; sslItemSeason.Text = season.Name; sslItemSeason.Selected = season.ID.Equals(PriceOnStore.SeasonPriceID); lstSllItemSeason.Add(sslItemSeason); } foreach (PriceItem priceItem in model.ListPrices) { priceItem.ListSeasons = lstSllItemSeason; } if (model.ListPrices != null && model.ListPrices.Count > 0) { model.ListPrices[0].Price = PriceOnStore.DefaultPrice; model.ListPrices[1].Price = PriceOnStore.SeasonPrice == -1 ? 0 : PriceOnStore.SeasonPrice; model.ListPrices[1].SeasonID = null;//PriceOnStore.SeasonPriceID; model.ListPrices[0].StoreID = model.StoreID; model.ListPrices[1].StoreID = model.StoreID; } //======Category model.ListCategories = this.GetSelectListCategoriesInte(StoreID, Commons.EProductType.Modifier.ToString("d")); // Updated 08282017 model.lstCateGroup = this.GetSelectListCategoriesInteSortParent(StoreID, Commons.EProductType.Modifier.ToString("d")); if (!string.IsNullOrEmpty(model.CategoryID)) { var cateChoose = model.lstCateGroup.Where(w => w.Id == model.CategoryID).FirstOrDefault(); if (cateChoose != null) { cateChoose.Selected = true; } } //============ LoadServiceCharge var objServiceCharge = _tipServiceChargeFactory.GetListTipServiceCharge(model.StoreID); if (objServiceCharge != null && objServiceCharge.Count > 0) { var value = objServiceCharge[0].Value; var IsCurrency = objServiceCharge[0].IsCurrency; var IsIncludedOnBill = objServiceCharge[0].IsIncludedOnBill; model.sServiceCharge = value.ToString(); if (!IsCurrency) { //$('#chbServiceCharge').attr('disabled', false); model.ServiceChargeDisabled = false; } else if (IsCurrency || IsIncludedOnBill) { //$('#chbServiceCharge').attr('disabled', true); model.ServiceChargeDisabled = true; } } //============== return(PartialView("_ProductItemOnStore", model)); }
public InteProductModels GetDetail(string id) { try { InteProductModels model = _factory.GetProductDetail(id); model.ImageURL = string.IsNullOrEmpty(model.ImageURL) ? Commons.Image100_100 : model.ImageURL; model.CurrencySymbol = CurrentUser.CurrencySymbol; //var lstStore = (List<SelectListItem>)ViewBag.ListStore; //model.ListStoreView = lstStore; var lstStore = (SelectList)ViewBag.StoreID; model.ListStoreView = lstStore.ToList(); model.ListStoreView = model.ListStoreView.OrderBy(o => o.Text).ToList(); int OffSet = 0; if (model.ListProductOnStore != null && model.ListProductOnStore.Count > 0) { model.ListProductOnStore = model.ListProductOnStore.OrderBy(oo => oo.StoreName).ToList(); foreach (var item in model.ListProductOnStore) { item.CurrencySymbol = model.CurrencySymbol; item.CurrencySymbol = CurrentUser.CurrencySymbol; item.OffSet = OffSet++; item.IsDeleteTemplate = true; item.ExpiredDate = item.ExpiredDate.Value.ToLocalTime(); if (item.ExpiredDate == Commons._ExpiredDate) { item.ExpiredDate = null; } model.ListStoreView.ForEach(x => { if (!x.Selected) { x.Selected = x.Value.Equals(item.StoreID) ? true : false; x.Disabled = x.Selected; } }); //=========== InteProductPriceModels PriceOnStore = item.PriceOnStore == null ? new InteProductPriceModels() : item.PriceOnStore; if (item.ListProductGroup != null) { List <InteGroupProductModels> groupP = item.ListProductGroup; for (int i = 0; i < item.ListProductGroup.Count; i++) { item.ListProductGroup[i].OffSet = i; item.ListProductGroup[i].StoreOffSet = item.OffSet; item.ListProductGroup[i].StoreID = item.StoreID; if (item.ListProductGroup[i].ListProductOnGroup != null) { for (int j = 0; j < item.ListProductGroup[i].ListProductOnGroup.Count; j++) { item.ListProductGroup[i].ListProductOnGroup[j].OffSet = j; } } } } //item.sServiceCharge = item.ServiceChargeValue == -1 ? "" : item.ServiceChargeValue.ToString(); //================ Get Category item.ListCategories = this.GetSelectListCategoriesInte(item.StoreID, Commons.EProductType.Modifier.ToString("d")); // Updated 08282017 item.lstCateGroup = this.GetSelectListCategoriesInteSortParent(item.StoreID, Commons.EProductType.Modifier.ToString("d")); if (!string.IsNullOrEmpty(item.CategoryID)) { var cateChoose = item.lstCateGroup.Where(w => w.Id == item.CategoryID).FirstOrDefault(); if (cateChoose != null) { cateChoose.Selected = true; } } //================Price SeasonFactory seasonf = new SeasonFactory(); List <SeasonModels> lstSs = seasonf.GetListSeason(item.StoreID, null, CurrentUser.ListOrganizationId); List <SelectListItem> lstSllItemSeason = new List <SelectListItem>(); SelectListItem sslItemSeason; foreach (var season in lstSs) { sslItemSeason = new SelectListItem(); sslItemSeason.Value = season.ID; sslItemSeason.Text = season.Name; sslItemSeason.Selected = season.ID.Equals(PriceOnStore.SeasonPriceID); lstSllItemSeason.Add(sslItemSeason); } foreach (PriceItem priceItem in item.ListPrices) { priceItem.ListSeasons = lstSllItemSeason; } item.ListPrices[0].Price = PriceOnStore.DefaultPrice; item.ListPrices[1].Price = PriceOnStore.SeasonPrice == -1 ? 0 : PriceOnStore.SeasonPrice; item.ListPrices[1].SeasonID = PriceOnStore.SeasonPriceID; item.ListPrices[1].PriceTag = PriceOnStore.SeasonPriceName; } } return(model); } catch (Exception ex) { _logger.Error("Product_Modifier_Detail: " + ex); return(null); } }