private void AddCakeToImportDetail() { try { FrmInforTabImputCouponImport.isAdd = true; FrmInforTabImputCouponImport.rowDetailCoupon = row; FrmInforTabImputCouponImport frm = new FrmInforTabImputCouponImport(); frm.StartPosition = FormStartPosition.CenterScreen; Int32 rowBeforeAdd = CakeDAO.Instance.AmountRows(); Int32 rowAfterAdd = CakeDAO.Instance.AmountRows(); if (rowBeforeAdd - rowAfterAdd == 0) { AddImportCoupon(true); } else { AddImportCoupon(false); } frm.ShowDialog(); if (!FrmInforTabImputCouponImport.isCancel) { LoadDetailCoupon(); LoadCakePresent(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void EditCouponDetail() { try { if (row < 0) { throw new Exception("Chọn sản phẩm ở chi tiết phiếu nhập"); } FrmInforTabImputCouponImport.idCouponDetail = Int32.Parse(dgvDetailImport.Rows[row].Cells[0].Value.ToString()); FrmInforTabImputCouponImport.idCake = Int32.Parse(dgvCakePresent.Rows[rowDgvCakePresent].Cells[0].Value.ToString()); FrmInforTabImputCouponImport.isAdd = false; FrmInforTabImputCouponImport.rowDetailCoupon = row; FrmInforTabImputCouponImport frm = new FrmInforTabImputCouponImport(); frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); LoadCakePresent(); LoadDetailCoupon(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }