private void labelFASAP18_MouseLeave(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; Cursor = Cursors.Default; lb.Image = Resources.DarkButton___Copy; lb.ForeColor = Color.Khaki; }
// labelite za Najbarani restrani sodrzat samo iminja na restorani // zatoa vo listata so restorani go baram restoranot koj go ima imeto na labelata sto e kliknata private void lblNaj1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { String restIme = lb.LblObject as String; Restoran obj = null; foreach (Restoran r in Restorani) { if (restIme.Equals(r.Ime)) { obj = r; break; } } IzvrsuvanjeNaracka fasapNaracka = new IzvrsuvanjeNaracka(obj, Conn); if (fasapNaracka.ShowDialog() == DialogResult.OK) { refresh(); } else { refresh(); } } }
private void lblMeni1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null && lb.LblObject is Meni) { CurrMenu = Restoran.GlavnoMeni; PostaviPateka(); indStavka = 0; CurrMenu = lb.LblObject as Meni; LabelFASAP label1 = new LabelFASAP(); LabelFASAP label2 = new LabelFASAP(); flowLayoutPanelFasap1.Controls.Add(label2); flowLayoutPanelFasap1.Controls.Add(label1); label1.Font = new Font("Trebuchet MS", 12, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); label1.UpdateObject(CurrMenu); label1.ForeColor = Color.Gold; label1.MouseEnter += new EventHandler(lblOsnovnoMeni_MouseEnter); label1.MouseLeave += new EventHandler(lblOsnovnoMeni_MouseLeave); label1.Click += new EventHandler(lblOsnovnoMeni_Click); label1.AutoSize = true; label2.Font = new Font("Trebuchet MS", 12, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); label2.ForeColor = Color.White; label2.Text = ">>"; label2.AutoSize = true; flowLayoutPanelFasap1.Invalidate(true); } this.PopolniListaStavki(); }
private void lblStavka1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { MenuComponent mc = lb.LblObject as MenuComponent; if (mc is Meni) { CurrMenu = mc; if (lb.LblObject != null && lb.LblObject is Meni) { indMeni = 0; CurrMenu = lb.LblObject as Meni; LabelFASAP label1 = new LabelFASAP(); LabelFASAP label2 = new LabelFASAP(); flowLayoutPanelFasap1.Controls.Add(label2); flowLayoutPanelFasap1.Controls.Add(label1); label1.Font = new Font("Trebuchet MS", 12, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); label1.UpdateObject(CurrMenu); label1.ForeColor = Color.Gold; label1.MouseEnter += new EventHandler(lblOsnovnoMeni_MouseEnter); label1.MouseLeave += new EventHandler(lblOsnovnoMeni_MouseLeave); label1.Click += new EventHandler(lblOsnovnoMeni_Click); label1.AutoSize = true; label2.Font = new Font("Trebuchet MS", 12, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); label2.ForeColor = Color.White; label2.Text = ">>"; label2.AutoSize = true; flowLayoutPanelFasap1.Invalidate(true); } PopolniListaStavki(); return; } try { CurrItem = mc.GetReference(CurrItem); } catch (Exception ex) { lblErrorMessage.Text = String.Format("{0} ", ex.Message); timer1.Stop(); errorMessageTime = 3; lblErrorMessage.Visible = true; timer1.Start(); } } if (CurrItem != null) { lblImeStavka.UpdateObject(CurrItem); try { lblCenaProizvod.Text = String.Format("{0} ден.", CurrItem.ComputeCost().ToString()); } catch (Exception) { } } }
private void labelFASAP18_MouseEnter(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; Cursor = Cursors.Hand; lb.Image = Resources.LightButton___Copy; lb.ForeColor = Color.SaddleBrown; }
private void lblMeni1_MouseLeave(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { Cursor = Cursors.Default; lb.Font = new Font("Trebuchet MS", 18, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } }
private void lbl1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { this.CurrentEmp = lb.LblObject as VrabotenInfo; this.MarkSelection(); this.PopolniVraboten(); } }
private void lbl1_DoubleClick(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { IzvrsuvanjeNaracka naracka = new IzvrsuvanjeNaracka(Restoran, Conn); naracka.Show(); } }
private void lblOsnovnoMeni_MouseEnter(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { Cursor = Cursors.Hand; lb.Image = Resources.LabelBackgroundSelected; lb.ForeColor = Color.SaddleBrown; } }
private void lblOsnovnoMeni_MouseLeave(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { Cursor = Cursors.Default; lb.Image = Resources.LabelBackground2; lb.ForeColor = Color.Gold; } }
private void lbl1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { CurrNaracka = lb.LblObject as Naracka; indStavki = 0; PostaviStavki(); PostaviNaracki(); } }
private void lblOsnovnoMeni_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; indStavka = 0; if (lb.LblObject != null && lb.LblObject is Meni) { CurrMenu = lb.LblObject as Meni; PostaviPateka(); PopolniListaStavki(); } }
private void lblKat1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { this.tekovnaKat = lb.LblObject as String; MarkSelection(); indexR = 0; FiltrirajRestorani(); } // MessageBox.Show("Tekoven grad: " + tekovenGrad + "tekovna k: " + tekovnaKat); }
private void lblNaj5_MouseEnter(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb == null) { MessageBox.Show("Ednakvo na null vo MouseEnter"); } if (lb.LblObject != null) { Cursor = Cursors.Hand; lb.Font = new Font("Trebuchet MS", 19, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } }
private void SetObject(LabelFASAP fs, Object obj) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (fs.InvokeRequired) { SetObjectCallback d = new SetObjectCallback(SetObject); this.Invoke(d, new object[] { fs, obj }); } else { fs.UpdateObject(obj); } }
private void lblImeStavka_MouseHover(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { MenuComponent mc = lb.LblObject as MenuComponent; if (mc.GetDescription() != null && mc.GetDescription().Trim() != "") { lblDescription.Location = Cursor.Position + new Size(10, 30); lblDescription.Text = mc.GetDescription() + " "; lblDescription.Visible = true; } } }
private void lblKupeno5_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { foreach (var obj in ListaKupeni) { obj.Image = Resources.LabelBackground2; obj.ForeColor = Color.White; } CurrOrderComponent = lb.LblObject as OrderComponent; lb.Image = Resources.LabelBackgroundSelected; lb.ForeColor = Color.SaddleBrown; } }
private void lblMeni1_MouseEnter(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { Cursor = Cursors.Hand; if (lb.LblObject is Meni) { lb.Font = new Font("Trebuchet MS", 17, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } else { lb.Font = new Font("Trebuchet MS", 17, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } } }
private void lblMeni1_MouseLeave(object sender, EventArgs e) { lblDescription.Visible = false; LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { Cursor = Cursors.Default; if (lb.LblObject is Meni) { lb.Font = new Font("Trebuchet MS", 16, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } else { lb.Font = new Font("Trebuchet MS", 16, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } } }
private void lblRest1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { Restoran obj = lb.LblObject as Restoran; IzvrsuvanjeNaracka fasapNaracka = new IzvrsuvanjeNaracka(obj, Conn); if (fasapNaracka.ShowDialog() == DialogResult.OK) { refresh(); } else { refresh(); } } }
private void lblMeni1_MouseLeave(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb == null) { MessageBox.Show("Ednakvo na null vo MouseLeave"); } if (lb.LblObject != null) { Cursor = Cursors.Default; if (lb.LblObject is Restoran) { lb.Font = new Font("Trebuchet MS", 18, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } else { lb.Font = new Font("Trebuchet MS", 18, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold))), System.Drawing.GraphicsUnit.Point, ((byte)(204))); } } }
private void lblStavka1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { if (IsChanged) { MessageBoxForm mbf = new MessageBoxForm("Имате несочувани промени. Дали сакате да ги сочувате?"); if (mbf.ShowDialog() == DialogResult.Yes) { SocuvajPromeni(); } else { IsChanged = false; } } SelectedComponent = lb.LblObject as MenuComponent; PopolniListaMenija(); } }
private void lbl1_Click(object sender, EventArgs e) { LabelFASAP lb = sender as LabelFASAP; if (lb.LblObject != null) { textBox1.Visible = false; this.Focus(); textBox1.Visible = true; Restoran = lb.LblObject as Restoran; Thread oThread = new Thread(new ThreadStart(PostaviSlobodniMasi)); oThread.Start(); CurrKontakt = 0; foreach (var obj in labeli) { obj.Image = Resources.LabelBackground2; obj.ForeColor = Color.Gold; } lb.Image = Resources.LabelBackgroundSelected; lb.ForeColor = Color.SaddleBrown; PostaviLabeli(); } }