コード例 #1
0
ファイル: TinhThuForm.cs プロジェクト: DzungHg/TinhGiaDigi2
        private void btnTinhThu_EpKim_Click(object sender, EventArgs e)
        {
            var idHangKH       = int.Parse(cboHangKH.SelectedValue.ToString());
            var thongTinBanDau = this.thongTinBanDauChoThPh(idHangKH, LoaiThanhPhamS.EpKim,
                                                            FormStateS.View, "Ép kim [Tính thử]", "Con");
            //tạo mới mục ép kim
            var mucThPhEpKim = new MucThPhEpKim();

            mucThPhEpKim.IdBaiIn         = 1;
            mucThPhEpKim.IdHangKhachHang = this.IdHangKhachHang;
            mucThPhEpKim.LoaiThanhPham   = LoaiThanhPhamS.EpKim;
            mucThPhEpKim.SoLuong         = 10; //Tạm
            mucThPhEpKim.DonViTinh       = "con";
            mucThPhEpKim.KhoEpRong       = 5f;
            mucThPhEpKim.KhoEpCao        = 5f;
            mucThPhEpKim.KhoToChayRong   = 32;//cm
            mucThPhEpKim.KhoToChayDai    = 22;
            mucThPhEpKim.SoLuongToChay   = 10;
            var frm = new ThPhEpKimForm(thongTinBanDau, mucThPhEpKim);

            frm.MinimizeBox   = false;
            frm.MaximizeBox   = false;
            frm.StartPosition = FormStartPosition.CenterParent;
            //Data gởi qua form
            frm.ShowDialog();
        }
コード例 #2
0
        public ThPhEpKimPresenter(IViewThPhEpKim view, MucThPhEpKim mucThPham)
        {
            View          = view;
            this.MucEpKim = mucThPham;

            View.ID              = this.MucEpKim.ID;
            View.IdBaiIn         = this.MucEpKim.IdBaiIn;
            View.IdHangKhachHang = this.MucEpKim.IdHangKhachHang;
            View.IdThanhPhamChon = this.MucEpKim.IdThanhPhamChon;
            View.LoaiThPh        = this.MucEpKim.LoaiThanhPham;
            View.SoLuong         = this.MucEpKim.SoLuong;
            View.DonViTinh       = this.MucEpKim.DonViTinh;
            View.IdNhuEpKimChon  = this.MucEpKim.IdNhuEpKimChon;

            View.KhoEpCao      = this.MucEpKim.KhoEpCao;
            View.KhoEpRong     = this.MucEpKim.KhoEpRong;
            View.KhoToChayRong = this.MucEpKim.KhoToChayRong;
            View.KhoToChayDai  = this.MucEpKim.KhoToChayDai;
            View.SoLuongToChay = this.MucEpKim.SoLuongToChay;
        }
コード例 #3
0
        private void ShowFormEpKim()
        {
            var thongTinBanDau = new ThongTinBanDauThanhPham
            {
                IdBaiIn           = 1,
                IdHangKhachHang   = this.IdHangKHChon,
                LoaiThanhPham     = LoaiThanhPhamS.EpKim,
                DonViTinh         = "Con",
                SoLuongSanPham    = 50,
                TieuDeForm        = "Ép kim [Tính thử]",
                SoLuongToChay     = 0,
                TinhTrangForm     = FormStateS.View,
                ThongDiepCanThiet = "Chỉ tính toán thử"
            };
            //muc emkim
            var mucThPhEpKim = new MucThPhEpKim();

            mucThPhEpKim.IdBaiIn         = 1;
            mucThPhEpKim.IdHangKhachHang = this.IdHangKHChon;
            mucThPhEpKim.LoaiThanhPham   = LoaiThanhPhamS.EpKim;
            mucThPhEpKim.SoLuong         = 100; //Tạm
            mucThPhEpKim.DonViTinh       = "con";
            mucThPhEpKim.KhoEpRong       = 5f;
            mucThPhEpKim.KhoEpCao        = 5f;

            var frm = new ThPhEpKimForm(thongTinBanDau, mucThPhEpKim);

            frm.TinhTrangForm = (int)FormStateS.View;


            frm.MinimizeBox   = false;
            frm.MaximizeBox   = false;
            frm.StartPosition = FormStartPosition.CenterParent;
            //Data gởi qua form


            frm.ShowDialog();
        }
コード例 #4
0
ファイル: ThPhEpKimForm.cs プロジェクト: DzungHg/TinhGiaDigi2
        public ThPhEpKimForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhEpKim mucThPham)
        {
            InitializeComponent();

            this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet;

            this.TinhTrangForm = thongTinBanDau.TinhTrangForm;


            epKimPres = new ThPhEpKimPresenter(this, mucThPham);
            //Load
            LoadEpKim();
            cboEpKim.SelectedIndex = -1;
            cboEpKim.SelectedIndex = 0;

            //Phải làm ở dây
            if (this.TinhTrangForm == FormStateS.Edit)
            {
                this.IdThanhPhamChon = mucThPham.IdThanhPhamChon;
                this.IdNhuEpKimChon  = mucThPham.IdNhuEpKimChon;
            }

            //Envent
            txtSoLuong.TextChanged           += new EventHandler(TextBoxes_TextChanged);
            lstNhuEpKim.SelectedIndexChanged += new EventHandler(TextBoxes_TextChanged);
            txtCao.TextChanged  += new EventHandler(TextBoxes_TextChanged);
            txtRong.TextChanged += new EventHandler(TextBoxes_TextChanged);

            txtSoLuong.Leave += new EventHandler(TextBoxes_Leave);
            txtCao.Leave     += new EventHandler(TextBoxes_Leave);
            txtRong.Leave    += new EventHandler(TextBoxes_Leave);

            txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator);
            txtCao.KeyPress     += new KeyPressEventHandler(InputValidator);
            txtRong.KeyPress    += new KeyPressEventHandler(InputValidator);
        }