public void Addchkbox(string text, string name, int t, int l, string gia_th, string gia_bh, EventHandler onClickEvent) { chk chkClick = new chk(name, onClickEvent); chkbox = new CheckBox(); tooltip = new ToolTip(); chkbox.Text = text; chkbox.Name = name; chkbox.Top = t; chkbox.Left = l; chkbox.Size = new System.Drawing.Size(270, 23);//32 chkbox.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); chkbox.Click += onClickEvent; chkbox.Tag = chkClick; DataRow r = m.getrowbyid(dt, "mavp=" + int.Parse(name)); chkbox.Checked = r != null; chkbox.ForeColor = (r != null) ? Color.Red : Color.Black; tab.Controls.Add(chkbox); if (bDongia_lietke) { tooltip.SetToolTip(chkbox, text + "\n" + ((gia_th == gia_bh) ? gia_th : gia_th + "\n" + gia_bh)); } else { tooltip.SetToolTip(chkbox, text); } }
public void chkEvent(object sender, EventArgs e) { Control ctrl = (Control)sender; chk c = ctrl.Tag as chk; DataRow r = m.getrowbyid(dsgia.Tables[0], "id=" + int.Parse(c.index.ToString())); if (r != null) { decimal d_dongia, d_vattu; if (m.bNuocngoai(s_mabn)) { d_dongia = decimal.Parse(r["gia_nn"].ToString()) * m.dTygia; d_vattu = decimal.Parse(r["vattu_nn"].ToString()) * m.dTygia; } else { string gia = m.field_gia(i_madoituong.ToString()); string giavt = "vattu_" + gia.Substring(4).Trim(); d_dongia = decimal.Parse(r[gia].ToString()); d_vattu = decimal.Parse(r[giavt].ToString()); } m.reprec(dt, "mavp=" + int.Parse(r["id"].ToString()), int.Parse(r["id"].ToString()), r["ten"].ToString(), r["dvt"].ToString(), d_dongia, d_vattu, 1); } r = m.getrowbyid(dt, "mavp=" + int.Parse(c.index.ToString())); ctrl.ForeColor = (r != null) ? Color.Red : Color.Black; }
public void chkEvent(object sender, EventArgs e) { Control ctrl = (Control)sender; chk c = ctrl.Tag as chk; DataRow r = m.getrowbyid(dsgia.Tables[0], "id=" + int.Parse(c.index.ToString())); if (r != null) { m.reprec(dt, "mavp=" + int.Parse(r["id"].ToString()), int.Parse(r["id"].ToString()), r["ten"].ToString(), "", 0, 0, 1); } }
public void chkEvent(object sender, EventArgs e) { Control ctrl = (Control)sender; chk c = ctrl.Tag as chk; DataRow r = m.getrowbyid(dsgia.Tables[0], "id=" + int.Parse(c.index.ToString())); if (r != null) { m.reprec(dt, "mavp=" + int.Parse(r["id"].ToString()), int.Parse(r["id"].ToString()), r["ten"].ToString(), r["dvt"].ToString(), decimal.Parse(r["gia_th"].ToString()), decimal.Parse(r["gia_dv"].ToString()), 1); } r = m.getrowbyid(dt, "mavp=" + int.Parse(c.index.ToString())); ctrl.ForeColor = (r != null) ? Color.Red : Color.Black; }
public void Addchkbox(string text, string name, int t, int l, string gia_th, string gia_bh, EventHandler onClickEvent) { chk chkClick = new chk(name, onClickEvent); chkbox = new CheckBox(); tooltip = new ToolTip(); chkbox.Text = text; chkbox.Name = name; chkbox.Top = t; chkbox.Left = l; chkbox.Width = 400; chkbox.Click += onClickEvent; chkbox.Tag = chkClick; tab.Controls.Add(chkbox); tooltip.SetToolTip(chkbox, (gia_th == gia_bh)?gia_th:gia_th + "\n" + gia_bh); }
public void Addchkbox(string text, string name, int t, int l, EventHandler onClickEvent) { chk chkClick = new chk(name, onClickEvent); chkbox = new CheckBox(); //tooltip=new ToolTip(); chkbox.Text = text.Trim(); chkbox.Name = name; chkbox.Top = t; chkbox.Left = l; chkbox.Size = new System.Drawing.Size(400, 30); chkbox.Click += onClickEvent; chkbox.Tag = chkClick; tab.Controls.Add(chkbox); //tooltip.SetToolTip(chkbox,(gia_th==gia_bh)?gia_th:gia_th+"\n"+gia_bh); }
public void Addchkbox(string text, string name, int t, int l, string gia_th, string gia_dv, EventHandler onClickEvent) { chk chkClick = new chk(name, onClickEvent); chkbox = new CheckBox(); tooltip = new ToolTip(); chkbox.Text = text; chkbox.Name = name; chkbox.Top = t; chkbox.Left = l; chkbox.Size = new System.Drawing.Size(270, 32); chkbox.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); chkbox.Click += onClickEvent; chkbox.Tag = chkClick; tab.Controls.Add(chkbox); tooltip.SetToolTip(chkbox, (gia_th == gia_dv)?gia_th:gia_th + "\n" + gia_dv); }
public void chkEvent(object sender, EventArgs e) { Control ctrl = (Control)sender; chk c = ctrl.Tag as chk; DataRow r = m.getrowbyid(dsgia.Tables[0], "id=" + int.Parse(c.index.ToString())); if (r != null) { decimal d_dongia, d_vattu; if (m.bNuocngoai(s_mabn)) { d_dongia = decimal.Parse(r["gia_nn"].ToString()) * m.dTygia; d_vattu = decimal.Parse(r["vattu_nn"].ToString()) * m.dTygia; } else { string gia = (i_madoituong == 1)?"gia_bh":"gia_th"; string giavt = (i_madoituong == 1)?"vattu_bh":"vattu_th"; d_dongia = decimal.Parse(r[gia].ToString()); d_vattu = decimal.Parse(r[giavt].ToString()); } m.reprec(dt, "mavp=" + int.Parse(r["id"].ToString()), int.Parse(r["id"].ToString()), r["ten"].ToString(), r["dvt"].ToString(), d_dongia, d_vattu); } }