private void btnTinhThu_GiaDongCuonLoXo_Click(object sender, EventArgs e) { var idHangKH = int.Parse(cboHangKH.SelectedValue.ToString()); var thongTinBanDauLX = new ThongTinBanDauDongCuon(); thongTinBanDauLX.TinhTrangForm = FormStateS.View; thongTinBanDauLX.TieuDeForm = "Đóng cuốn [Tính thử]"; thongTinBanDauLX.MoTextSoLuongCuon = true; //Tạo mục đóng cuốn var mucDongCuonLX = new MucDongCuonLoXo(); mucDongCuonLX.IdBaiIn = 1; mucDongCuonLX.IdHangKhachHang = this.IdHangKhachHang; mucDongCuonLX.SoLuong = 1; //Vì số lượng có thể không trùng mucDongCuonLX.DonViTinh = "cuốn"; mucDongCuonLX.GayCao = 10; mucDongCuonLX.GayDay = 0.5f; mucDongCuonLX.LoaiThanhPham = LoaiThanhPhamS.DongCuon; mucDongCuonLX.KieuDongCuon = KieuDongCuonS.LoXo; var frm = new ThPhDongCuonLoXoForm(thongTinBanDauLX, mucDongCuonLX); frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; //Data gởi qua form frm.ShowDialog(); }
public ThPhDongCuonLoXoForm(ThongTinBanDauDongCuon thongTinBanDau, MucDongCuonLoXo mucThPhamDongCuon) { InitializeComponent(); this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet; this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.Text = thongTinBanDau.TieuDeForm; txtSoLuong.Enabled = thongTinBanDau.MoTextSoLuongCuon; thPhLoXoPres = new ThPhDongCuonLoXoPresenter(this, mucThPhamDongCuon); LoadDongCuonLoXo(); cboMayLoXo.SelectedIndex = -1; cboMayLoXo.SelectedIndex = 0; //Load Nhu ep LoadLoXoDongCuon(); //Load //Mục này phải làm ở đây if (this.TinhTrangForm == FormStateS.Edit || this.IdThanhPhamChon > 0) { this.IdThanhPhamChon = mucThPhamDongCuon.IdThanhPhamChon; this.IdLoXoDongCuonChon = mucThPhamDongCuon.IdLoXoChon; } //Envent txtSoLuong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtGayDay.TextChanged += new EventHandler(TextBoxes_TextChanged); txtGayCao.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLuong.Leave += new EventHandler(TextBoxes_Leave); txtGayDay.TextChanged += new EventHandler(TextBoxes_Leave); txtGayCao.TextChanged += new EventHandler(TextBoxes_Leave); lstLoXo.SelectedItemChanged += new EventHandler(ListView_SelectedItemChanged); cboMayLoXo.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownList_SelectedIndexChanged); txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator); txtGayDay.KeyPress += new KeyPressEventHandler(InputValidator); txtGayCao.KeyPress += new KeyPressEventHandler(InputValidator); }
public ThPhDongCuonLoXoPresenter(IViewThPhDongCuonLoXo view, MucDongCuonLoXo mucThPham) { View = view; View = view; this.MucDongCuon = mucThPham; //Cập nhật form View.ID = mucThPham.ID; View.IdBaiIn = mucThPham.IdBaiIn; View.IdHangKhachHang = mucThPham.IdHangKhachHang; View.IdThanhPhamChon = mucThPham.IdThanhPhamChon; View.LoaiThPh = mucThPham.LoaiThanhPham; View.KieuDongCuon = mucThPham.KieuDongCuon; View.SoLuong = mucThPham.SoLuong; View.DonViTinh = mucThPham.DonViTinh; View.IdLoXoDongCuonChon = mucThPham.IdLoXoChon; View.GayCao = mucThPham.GayCao; View.GayDay = mucThPham.GayDay; }
private void ThemDongCuon() {///Hiện tại Id chọn các dịch vụ đóng cuốn là Id của MonDongCuon ///Lấy được món đóng cuốn var monDongCuon = inSachPres.DocMonDongCuonTheoID(); switch (monDongCuon.KieuDongCuon) //Thiết lập chỉ 2 loại keo và lò xo { case KieuDongCuonS.KimKeoNep: //Điều chỉnh thông tin ban đầu var thongTinBanDauCuonKeo = ThongTinBanDauCuonKeo(); thongTinBanDauCuonKeo.TinhTrangForm = FormStateS.New; thongTinBanDauCuonKeo.TieuDeForm = "[Mới] Đóng cuốn"; //tạo mục thành phẩm đóng cuốn var mucThPhamDongCuon = new MucDongCuon(); mucThPhamDongCuon.IdBaiIn = this.ID; mucThPhamDongCuon.IdHangKhachHang = this.IdHangKhachHang; mucThPhamDongCuon.IdThanhPhamChon = inSachPres.DocMonDongCuonTheoID().IdGoc; mucThPhamDongCuon.LoaiThanhPham = LoaiThanhPhamS.DongCuon; mucThPhamDongCuon.KieuDongCuon = KieuDongCuonS.KimKeoNep; mucThPhamDongCuon.SoLuong = this.SoCuon; mucThPhamDongCuon.DonViTinh = "cuốn"; var frm1 = new ThPhDongCuonForm(thongTinBanDauCuonKeo, mucThPhamDongCuon); frm1.MinimizeBox = false; frm1.MaximizeBox = false; frm1.StartPosition = FormStartPosition.CenterParent; //Data gởi qua ỏm frm1.ShowDialog(); if (frm1.DialogResult == System.Windows.Forms.DialogResult.OK) { XuLyNutOKClick_FormDongCuon(frm1); //MessageBox.Show(this.CauHinhSanPhamS.Count().ToString()); //Cap nhat noi dung đóng cuốn CapNhatChiTietDongCuon(); } break; case KieuDongCuonS.LoXo: var mucDongCuon = new MucDongCuonLoXo(); mucDongCuon.IdBaiIn = this.ID; mucDongCuon.IdHangKhachHang = this.IdHangKhachHang; mucDongCuon.SoLuong = this.SoCuon; //Vì số lượng có thể không trùng mucDongCuon.DonViTinh = "cuốn"; mucDongCuon.GayCao = this.SachCao; mucDongCuon.GayDay = this.GayDay; mucDongCuon.LoaiThanhPham = LoaiThanhPhamS.DongCuon; //Tiếp tục thông tin ban đầu var thongTinBanDauCuonLoXo = this.ThongTinBanDauCuonLoXo(); thongTinBanDauCuonLoXo.TieuDeForm = "[Mới] Cuốn Lò xo"; thongTinBanDauCuonLoXo.TinhTrangForm = FormStateS.New; //điều chỉnh mục thành phẩm mucDongCuon.KieuDongCuon = KieuDongCuonS.LoXo; var frm2 = new ThPhDongCuonLoXoForm(thongTinBanDauCuonLoXo, mucDongCuon); frm2.MinimizeBox = false; frm2.MaximizeBox = false; frm2.StartPosition = FormStartPosition.CenterParent; frm2.ShowDialog(); if (frm2.DialogResult == System.Windows.Forms.DialogResult.OK) { XuLyNutOKClick_FormDongCuonLoXo(frm2); //MessageBox.Show(this.CauHinhSanPhamS.Count().ToString()); CapNhatChiTietDongCuon(); } break; case KieuDongCuonS.MoPhang: var mucDongCuonMP = new MucDongCuonMoPhang(); mucDongCuonMP.IdBaiIn = this.ID; mucDongCuonMP.IdHangKhachHang = this.IdHangKhachHang; mucDongCuonMP.SoLuong = this.SoCuon; //Vì số lượng có thể không trùng mucDongCuonMP.DonViTinh = "cuốn"; mucDongCuonMP.SoToDoi = this.SoTrangRuot / 2; mucDongCuonMP.LoaiThanhPham = LoaiThanhPhamS.DongCuon; //Tiếp tục thông tin ban đầu var thongTinBanDauCuonMP = this.ThongTinBanDauCuonMoPhang(); thongTinBanDauCuonMP.TieuDeForm = "[Mới] Cuốn Mở phẳng"; thongTinBanDauCuonMP.TinhTrangForm = FormStateS.New; //điều chỉnh mục thành phẩm mucDongCuonMP.KieuDongCuon = KieuDongCuonS.MoPhang; var frm3 = new ThPhDongCuonMoPhangForm(thongTinBanDauCuonMP, mucDongCuonMP); frm3.MinimizeBox = false; frm3.MaximizeBox = false; frm3.StartPosition = FormStartPosition.CenterParent; frm3.ShowDialog(); if (frm3.DialogResult == System.Windows.Forms.DialogResult.OK) { XuLyNutOKClick_FormDongCuonMoPhang(frm3); //MessageBox.Show(this.CauHinhSanPhamS.Count().ToString()); CapNhatChiTietDongCuon(); } break; } }