public bool sua(viTri t) { if (string.IsNullOrEmpty(t.maVT)) { return(false); } vt.update(t); return(true); }
public bool insert(viTri t) { if (dataTable("select * from VITRI where MaVT ='" + t.maVT + "'").Rows.Count > 0) { return(false); } string sqlCommand = string.Format("insert into VITRI values ('{0}','{1}','{2}','{3}')", t.maVT, t.khu, t.ke, t.ngan); Excute(sqlCommand); return(true); }
private void Insert(object sender, EventArgs e) { try { viTri v = new viTri(); v.maVT = LocationID.Text; v.khu = Zone.Text; v.ke = Shelf.Text; v.ngan = Cell.Text; if (v.isNull()) { toolTip1.ToolTipTitle = "Warning"; toolTip1.Show("Please enter full information", windowsUIButtonPanel1, windowsUIButtonPanel1.Location, 5000); } else { if (vt.them(v)) { Location_Load(sender, e); resetText(); } else { if (vt.sua(v)) { Location_Load(sender, e); resetText(); } else { return; } } } } catch (Exception exc) { MessageBox.Show(exc.Message, "Oops", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void update(viTri t) { string sqlCommand = string.Format("update VITRI set Khu = '{0}', Ke = '{1}', Ngan = '{2}' where MaVT = '{3}'", t.khu, t.ke, t.ngan, t.maVT); Excute(sqlCommand); }
public bool them(viTri t) { return(vt.insert(t)); }