public bool insert(GiangVienDTO gv) { string ma = "GV_" + TimingDTO.getTimeString("dd", "MM", "yy", "HH", "mm", "ss"); gv.Id = ma; gv.Created = DateTime.Now; gv.Updated = gv.Created; return(GiangVienDAL.Instance.insert(gv)); }
private bool Them(bool error) { if (isInsert && !error) { PhongHocDTO ph = new PhongHocDTO(); ph.Name = tb_ten.Text.Trim(); ph.Note = tb_ghichu.Text.Trim(); ph.MaxSeat = int.Parse(tb_succhua.Text.Trim()); ph.Created = DateTime.Now; ph.Updated = ph.Created; ph.Id = "PH_" + TimingDTO.getTimeString("dd", "MM", "yy", "HH", "mm", "ss"); if (PhongHocBLL.Instance.insert(ph)) { MessageBox.Show("Thêm phòng học thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); return(true); } } else if (!error) { PhongHocDTO ph = new PhongHocDTO(); ph.Id = id; ph.Name = tb_ten.Text; ph.MaxSeat = int.Parse(tb_succhua.Text); ph.Note = tb_ghichu.Text; ph.Updated = DateTime.Now; if (PhongHocBLL.Instance.update(ph)) { return(true); } } return(false); }