private void btnSave_Click(object sender, EventArgs e) { try { if (!checkValid()) { return; } WorkingDiariesLocationModel dModel; if (_isAdd) { dModel = new WorkingDiariesLocationModel(); } else { dModel = (WorkingDiariesLocationModel)WorkingDiariesLocationBO.Instance.FindByPK(TextUtils.ToInt(grvData.GetFocusedRowCellValue(colID))); } dModel.Code = txtCode.Text.Trim(); dModel.Name = txtName.Text.Trim(); if (_isAdd) { WorkingDiariesLocationBO.Instance.Insert(dModel); } else { WorkingDiariesLocationBO.Instance.Update(dModel); } loadGrid(); SetInterface(false); ClearInterface(); } catch (Exception ex) { MessageBox.Show(ex.Message, TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected WorkingDiariesLocationFacade(WorkingDiariesLocationModel model) : base(model) { }