public List <HomeList> GetHomeList(string homeId) { List <HomeList> list = new List <HomeList>(); StringBuilder builder = new StringBuilder(); builder.AppendFormat(MallSqls.SELECT_HOME_LIST_BY_HOME_ID, homeId); string sql = builder.ToString(); DataTable dt = DatabaseOperationWeb.ExecuteSelectDS(sql, "T").Tables[0]; if (dt != null) { foreach (DataRow dr in dt.Rows) { HomeList homeList = new HomeList { img = dr["IMG"].ToString(), title = dr["TITLE"].ToString(), price = dr["PRICE"].ToString(), praise = dr["PRAISE"].ToString(), urlType = dr["URL_TYPE"].ToString(), urlValue = dr["URL_VALUE"].ToString(), }; list.Add(homeList); } } return(list); }
public HomeListPresenter(HomeList view) : base(view) { PopulateWarehouseGrid(); View.AddButton.Click += onAddClick; View.RemoveButton.Click += onRemoveClick; FGManager.Instance.Warehouse.ProductList.CollectionChanged += onAddedProduct; }
public IActionResult Index(HomeList homeList) { var newList = dao.GetAllParks(); homeList.parkList = newList.ToList(); return(View(homeList)); }
public ActionResult DeleteConfirmed(int id) { HomeList homeList = db.HomeLists.Find(id); db.HomeLists.Remove(homeList); db.SaveChanges(); return(RedirectToAction("Index")); }
private void HomeClick() { _homeList = new HomeList(); HomeListPresenter p = new HomeListPresenter(_homeList); MainPage.TableLayoutPanel.Controls.Clear(); MainPage.TableLayoutPanel.Controls.Add(_homeList); MainPage.UserLabel.Text = FGManager.Instance.Logged + " (LOGOUT)"; }
public ActionResult Edit([Bind(Include = "Id,TownName,Color")] HomeList homeList) { if (ModelState.IsValid) { db.Entry(homeList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homeList)); }
public ActionResult Create([Bind(Include = "Id,TownName,Color")] HomeList homeList) { if (ModelState.IsValid) { db.HomeLists.Add(homeList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homeList)); }
// GET: HomeList/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HomeList homeList = db.HomeLists.Find(id); if (homeList == null) { return(HttpNotFound()); } return(View(homeList)); }
public MainPagePresenter(MainPage view) : base(view) { _homeList = new HomeList(); _selectProduct = new SelezionaProdotti(); _subject = new MostraSubject(); _fatture = new MostraFatture(); _noleggi = new MostraNoleggi(); MainPage.HomeLabel.Click += onHomeClick; MainPage.SearchLabelFatture.Click += onSearchLabelFattureClick; MainPage.SearchLabelRent.Click += onSearchLabelRentClick; MainPage.SearchSubjectLabel.Click += onSearchLabelSubjectClick; MainPage.SelectProductLabel.Click += onSelectProductLabelClick; MainPage.UserLabel.Click += onUserLabelClick; //a default si apre la Home HomeClick(); }
public ActionResult Index() { HomeList homeList = new HomeList(); //New list homeList.newList = db.SANPHAMs.Where(sp => sp.DAXOA.Value.Equals(false) && sp.SANPHAMBAN.Value.Equals(true) && sp.SANPHAMMOI.Value.Equals(true)).ToList(); for (int i = 0; i < homeList.newList.Count; i++) { int makhuyenmai = homeList.newList[i].MAKHUYENMAI.Value; if (makhuyenmai != 0) { var _mkm = db.KHUYENMAIs.Where(km => km.DAXOA.Value.Equals(false) && km.MA.Equals(makhuyenmai)).SingleOrDefault(); float dongiagiam = (float)(homeList.newList[i].DONGIABAN * (100 - _mkm.NOIDUNG.Value)) / 100; homeList.newListPromotion.Add(dongiagiam); } else { homeList.newListPromotion.Add(0); } } //Special List homeList.specialList = db.SANPHAMs.Where(sp => sp.DAXOA.Value.Equals(false) && sp.SANPHAMBAN.Value.Equals(true) && sp.SANPHAMBANCHAY.Value.Equals(true)).ToList(); for (int i = 0; i < homeList.specialList.Count; i++) { int makhuyenmai = homeList.specialList[i].MAKHUYENMAI.Value; if (makhuyenmai != 0) { var _mkm = db.KHUYENMAIs.Where(km => km.DAXOA.Value.Equals(false) && km.MA.Equals(makhuyenmai)).SingleOrDefault(); float dongiagiam = (float)(homeList.specialList[i].DONGIABAN * (100 - _mkm.NOIDUNG.Value)) / 100; homeList.specialListPromotion.Add(dongiagiam); } else { homeList.specialListPromotion.Add(0); } } return(View(homeList)); }
//FUNCTION: //Purpose: To get the data sent by the server and to translate it into a command public void GetData(byte[] data, string iD) { string msg = ASCIIEncoding.ASCII.GetString(data); if (msg.StartsWith("POINTUS::")) //Our team scores a point { string msgs = msg.Replace("POINTUS::", ""); if (msgs.StartsWith("+")) { OurPoints++; } if (msgs.StartsWith("-")) { OurPoints--; } } if (msg.StartsWith("POINTTHEM::")) //Other team scores a point { string msgs = msg.Replace("POINTTHEM::", ""); if (msgs.StartsWith("+")) { TheirPoints++; } if (msgs.StartsWith("-")) { TheirPoints--; } } if (msg.StartsWith("MSG::")) //Text message from server { string msgs = msg.Replace("MSG::", ""); ServerMsg = msgs; } if (msg.StartsWith("NT::")) //Name taken (not currently in use) { string msgs = msg.Replace("NT::", ""); NameTaken = true; } if (msg.StartsWith("TEAMADD::")) //Team member joined { string msgs = msg.Replace("TEAMADD::", ""); HomeList.Add(msgs); } if (msg.StartsWith("OPPADD::")) //Opponent team member joined { string msgs = msg.Replace("OPPADD::", ""); AwayList.Add(msgs); } if (msg.StartsWith("ROUNDSTART::")) //Round has started { string msgs = msg.Replace("ROUNDSTART::", ""); StartRound(msgs); } if (msg.StartsWith("ROUNDSTOP::")) //Round has stopped { string msgs = msg.Replace("ROUNDEND::", ""); StopRound(); } if (msg.StartsWith("TEAMFULL::")) //Team selected is full { string msgs = msg.Replace("TF::", ""); TeamFull = true; } if (msg.StartsWith("TEAMOPT::")) //List of team options { string msgs = msg.Replace("TEAMOPT::", ""); TeamOptions = msgs.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries).ToList(); } if (msg.StartsWith("TEAMLIST::")) //List of team members at join { string msgs = msg.Replace("TEAMLIST::", ""); HomeList = msgs.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries).ToList(); } if (msg.StartsWith("OPPLIST::")) //List of opponent team members at join { string msgs = msg.Replace("OPPLIST::", ""); AwayList = msgs.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries).ToList(); } if (msg.StartsWith("CLIST::")) //Hidden client list { string msgs = msg.Replace("CLIST::", ""); ConnList = msgs.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries).ToList(); } if (msg.StartsWith("DISCONNECT::")) //Client has disconnected { string msgs = msg.Replace("DISCONNECT::", ""); if (HomeList.Contains(msgs)) { HomeList.Remove(msgs); } if (AwayList.Contains(msgs)) { AwayList.Remove(msgs); } ConnList.Remove(msgs); } if (msg.StartsWith("CONNECT::")) //Client has connected { string msgs = msg.Replace("CONNECT::", ""); ConnList.Add(msgs); } if (msg.StartsWith("PING::")) //Ping (not in use) { string msgs = msg.Replace("PING::", ""); IsConnected = true; } }