private void dgv_DoubleClick(object sender, EventArgs e)
        {
            if(this.dgv.CurrentRow != null)
            {
                finfoXeGui form = new finfoXeGui(fQuanLy, "Other");
                string id = this.dgv.CurrentRow.Cells[0].Value.ToString();
                DataTable table = this.vehicleParkingBUS.getVehicleByID(id);
                form.pBHinh1.Image = Image.FromStream(this.picture(table, "Image 1"));
                form.pBHinh1.SizeMode = PictureBoxSizeMode.StretchImage;

                form.pBHinh2.Image = Image.FromStream(this.picture(table, "Image 2"));
                form.pBHinh2.SizeMode = PictureBoxSizeMode.StretchImage;

                form.txtID.Text = id.ToString();

                if (int.Parse(table.Rows[0]["Type"].ToString()) == 0)
                {
                    form.txtLoaiXe.Text = "Xe Đạp";
                    form.lbHinh1.Text = "Hình Xe";
                    form.lbHinh2.Text = "Người Gửi";
                }
                else if (int.Parse(table.Rows[0]["Type"].ToString()) == 1)
                {
                    form.txtLoaiXe.Text = "Xe Máy";
                    form.lbHinh1.Text = "Bảng Số";
                    form.lbHinh2.Text = "Người Gửi";
                }
                else
                {
                    form.txtLoaiXe.Text = "Xe Hơi";
                    form.lbHinh1.Text = "Bảng Số";
                    form.lbHinh2.Text = "Hiệu Xe";
                }


                //Xác định thứ trong tuần
                int thu = this.xacDinhThu();

                String loaiGui = this.LoaiGui(int.Parse(table.Rows[0]["Type park"].ToString()));

                form.txtLoaiGui.Text = loaiGui;

                int phi_theo_thu = 0;
                if (loaiGui != "")
                {
                    phi_theo_thu = this.vehicleParkingBUS.layTienTheoThu(thu, loaiGui);
                }

                form.txtDTGui.Text = table.Rows[0]["Time in"].ToString();

                form.txtTongTien.Text = phi_theo_thu.ToString();

                this.fQuanLy.openChildForm(form);
            }    
        }
示例#2
0
        private void btnBike_Click(object sender, EventArgs e)
        {
            Guna.UI.WinForms.GunaGradientButton btn = sender as Guna.UI.WinForms.GunaGradientButton;
            string id = btn.Text;

            finfoXeGui form  = new finfoXeGui(formQuanLyXeGui, "BaiXe");
            DataTable  table = this.VehicleBUS.getVehicleByID(id);

            form.pBHinh1.Image    = Image.FromStream(this.picture(table, "Image 1"));
            form.pBHinh1.SizeMode = PictureBoxSizeMode.StretchImage;

            form.pBHinh2.Image    = Image.FromStream(this.picture(table, "Image 2"));
            form.pBHinh2.SizeMode = PictureBoxSizeMode.StretchImage;

            form.txtID.Text = id.ToString();

            form.txtLoaiXe.Text = "Xe Đạp";

            form.lbHinh1.Text = "Hình Xe";

            form.lbHinh2.Text = "Người Gửi";

            //Xác định thứ trong tuần
            int thu = this.xacDinhThu();

            String loaiGui = this.LoaiGui(id);

            form.txtLoaiGui.Text = loaiGui;

            int phi_theo_thu = 0;

            if (loaiGui != "")
            {
                phi_theo_thu = this.VehicleBUS.layTienTheoThu(thu, loaiGui);
            }

            form.txtDTGui.Text = table.Rows[0]["Time in"].ToString();

            form.txtTongTien.Text = phi_theo_thu.ToString();

            this.formQuanLyXeGui.openChildForm(form);
        }