private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (obj == null) { obj = new Model.SUPPLIER(); obj.SUPPLIER_NAME = tboxName.Text; obj.TAX_CODE = tboxTaxCode.Text; obj.PHONE = tboxPhone.Text; obj.ADDRESS = tboxAddress.Text; obj.RECORD_STATUS = "A"; preSupplier.saveSupplier(obj); } else { obj.SUPPLIER_NAME = tboxName.Text; obj.TAX_CODE = tboxTaxCode.Text; obj.PHONE = tboxPhone.Text; obj.ADDRESS = tboxAddress.Text; obj.RECORD_STATUS = "A"; preSupplier.updateSupplier(obj); } beforeForm.WindowState = FormWindowState.Maximized; beforeForm.Activate(); //Close(); }
public frmAddSupplier(SupplierPresenter preSupplier, Model.SUPPLIER obj) { this.preSupplier = preSupplier; this.obj = obj; InitializeComponent(); tboxName.Text = obj.SUPPLIER_NAME; tboxTaxCode.Text = obj.TAX_CODE; tboxPhone.Text = obj.PHONE; tboxAddress.Text = obj.ADDRESS; }
private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { GridView gridView = gridSupplier.FocusedView as GridView; Model.SUPPLIER obj = new Model.SUPPLIER(); obj.SUPPLIER_ID = Convert.ToInt32(gridView.GetFocusedRowCellValue("SUPPLIER_ID").ToString()); obj.SUPPLIER_CODE = gridView.GetFocusedRowCellValue("SUPPLIER_CODE").ToString(); obj.SUPPLIER_NAME = gridView.GetFocusedRowCellValue("SUPPLIER_NAME").ToString(); obj.TAX_CODE = gridView.GetFocusedRowCellValue("TAX_CODE").ToString(); obj.PHONE = gridView.GetFocusedRowCellValue("PHONE").ToString(); obj.ADDRESS = gridView.GetFocusedRowCellValue("ADDRESS").ToString(); //frmAddSupplier frmAdd = new frmAddSupplier(preSupplier, obj); //frmAdd.ShowDialog(); frmAddSupplier frmAdd = new frmAddSupplier(preSupplier, obj, this); frmAdd.WindowState = FormWindowState.Maximized; frmAdd.FormBorderStyle = FormBorderStyle.None; frmAdd.MdiParent = this.MdiParent; frmAdd.Dock = DockStyle.Fill; frmAdd.Show(); }
public frmAddSupplier(SupplierPresenter preSupplier, Model.SUPPLIER obj, Form beforeForm) : this(preSupplier, obj) { this.beforeForm = beforeForm; }