private void InsertData() { data = new DTO.NhatKyMuaHang(); data.IdUser = FormMain.user.Id; data.Ten = tbTen.Text; data.Date = DateTime.Now; data.ThanhTien = ConvertUtil.ConvertToLong(tbThanhTien.Text.Replace(Constant.SYMBOL_LINK_MONEY, string.Empty)); data.GhiChu = tbGhiChu.Text; if (NhatKyMuaHangBus.Insert(data, FormMain.user)) { if (MessageBox.Show(string.Format(Constant.MESSAGE_INSERT_SUCCESS, "Nhật ký mua hàng - " + data.Id) + Constant.MESSAGE_NEW_LINE + Constant.MESSAGE_CONTINUE, Constant.CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { this.Dispose(); } else { RefreshData(); } } else { if (MessageBox.Show(string.Format(Constant.MESSAGE_INSERT_ERROR_DUPLICATED, tbTen.Text) + Constant.MESSAGE_NEW_LINE + Constant.MESSAGE_EXIT, Constant.CAPTION_ERROR, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { this.Dispose(); } } }
public UcInfo() { InitializeComponent(); data = new DTO.NhatKyMuaHang(); isUpdate = false; if (Init()) { RefreshData(); } else { this.Visible = false; } }
public UcInfo(DTO.NhatKyMuaHang data) { InitializeComponent(); this.data = data; isUpdate = true; lbSelect.Text = Constant.DEFAULT_TITLE_EDIT; if (Init()) { tbTen.Text = data.Ten; tbThanhTien.Text = data.ThanhTien.ToString(Constant.DEFAULT_FORMAT_MONEY); tbGhiChu.Text = data.GhiChu; } else { this.Visible = false; } }
partial void DeleteNhatKyMuaHang(NhatKyMuaHang instance);
partial void UpdateNhatKyMuaHang(NhatKyMuaHang instance);
partial void InsertNhatKyMuaHang(NhatKyMuaHang instance);
private void detach_NhatKyMuaHangs(NhatKyMuaHang entity) { this.SendPropertyChanging(); entity.User = null; }
public static bool Update(NhatKyMuaHang data, User user) { return NhatKyMuaHangDao.Update(data, user); }
public static bool Insert(NhatKyMuaHang data, User user) { return NhatKyMuaHangDao.Insert(data, user); }