private void DoiGiayMoi() { //Tao giay de in var mucGiayDeIn = new GiayDeIn(32, 48.5f, 1, 0, 1, 1, false, 0, "", 1, 1, 1, 0);// //Tiến hành gắn var frm = new GiayInDanhThiepForm(thongTinBanDauChoGiayIn(FormStateS.New), mucGiayDeIn); frm.Text = "[Đổi] Giấy in Danh thiếp"; frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); if (frm.DialogResult == System.Windows.Forms.DialogResult.OK) { XuLyNutOKTrenFormChuanBiGiay_Click(frm); //MessageBox.Show(this.CauHinhSanPhamS.Count().ToString()); } }
private void XuLyNutOKTrenFormChuanBiGiay_Click(GiayInDanhThiepForm frm) { switch (frm.TinhTrangForm) { case FormStateS.New: this.GiayDeInChon = frm.DocGiayDeIn(); this.TenGiayChon = this.GiayDeInChon.TenGiayIn; this.TienGiay = this.GiayDeInChon.ThanhTienGiay; txtSoLuong.Enabled = false; //Lock lại //Cập nhật tính toán TinhToanToanBo(); break; case FormStateS.Edit: //Đổi ID vì thêm mới là có id mới this.GiayDeInChon = frm.DocGiayDeIn(); this.TenGiayChon = this.GiayDeInChon.TenGiayIn; this.TienGiay = this.GiayDeInChon.ThanhTienGiay; txtSoLuong.Enabled = false; //Lock lại //Cập nhật tính toán TinhToanToanBo(); break; } }
private void SuaGiayIn() { if (this.GiayDeInChon == null) { return; } var frm = new GiayInDanhThiepForm(thongTinBanDauChoGiayIn(FormStateS.Edit), this.GiayDeInChon); frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; frm.Text = "[Sửa] Giấy In"; frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); //Xử Bấm click //trường hợp edit if (frm.DialogResult == System.Windows.Forms.DialogResult.OK) { XuLyNutOKTrenFormChuanBiGiay_Click(frm);//Cập nhật dữ liệu } }