private void btnPthu_Add_Click(object sender, EventArgs e)
        {
            var _Frmbar_Rent_Reserve_Phieu_Thu = new Frmbar_Rent_Reserve_Phieu_Thu();

            _Frmbar_Rent_Reserve_Phieu_Thu.barSystem.Visible = false;
            _Frmbar_Rent_Reserve_Phieu_Thu.Icon        = GoobizFrame.Windows.MdiUtils.ThemeSettings.GetProductIcon();
            _Frmbar_Rent_Reserve_Phieu_Thu.WindowState = System.Windows.Forms.FormWindowState.Normal;

            _Frmbar_Rent_Reserve_Phieu_Thu.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            _Frmbar_Rent_Reserve_Phieu_Thu.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;

            _Frmbar_Rent_Reserve_Phieu_Thu.ChangeFormState(GoobizFrame.Windows.Forms.FormState.Add);
            _Frmbar_Rent_Reserve_Phieu_Thu.PerformAdd();
            _Frmbar_Rent_Reserve_Phieu_Thu.ShowDialog();

            var SelectedObject = _Frmbar_Rent_Reserve_Phieu_Thu.GetType().GetProperty("SelectedWare_Phieu_Thu").GetValue(_Frmbar_Rent_Reserve_Phieu_Thu, null)
                                 as Ecm.WebReferences.WareService.Ware_Phieu_Thu;

            if (SelectedObject != null)
            {
                var ndr = dsBar_Rent_Reserve_Phieuthu.Tables[0].NewRow();
                ndr["Id_Reserve_Phieuthu"] = DateTime.Now.Ticks;
                ndr["Guid_Reserve"]        = Current_Guid_Reserve;
                ndr["Id_Phieu_Thu"]        = SelectedObject.Id_Phieu_Thu;
                ndr["Id_Reserve"]          = Current_Id_Reserve;
                ndr["Sochungtu"]           = SelectedObject.Sochungtu;
                ndr["Ngay_Chungtu"]        = SelectedObject.Ngay_Chungtu;
                ndr["Lydo"]      = SelectedObject.Lydo;
                ndr["Sotien"]    = SelectedObject.Sotien;
                ndr["Id_Tiente"] = SelectedObject.Id_Tiente;
                dsBar_Rent_Reserve_Phieuthu.Tables[0].Rows.Add(ndr);
                this.chkThanhtoantruoc.Checked = true;
            }
        }
        private void btnPthu_Edit_Click(object sender, EventArgs e)
        {
            if ("" + gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Id_Phieu_Thu") == "")
            {
                GoobizFrame.Windows.Forms.UserMessage.Show("SYS_EMPTY_COLLECTION", new string[] { "phiếu thu" });
                return;
            }
            else
            {
                var _Frmbar_Rent_Reserve_Phieu_Thu = new Frmbar_Rent_Reserve_Phieu_Thu();
                _Frmbar_Rent_Reserve_Phieu_Thu.SelectedWare_Phieu_Thu = new WebReferences.WareService.Ware_Phieu_Thu()
                {
                    Id_Phieu_Thu   = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Id_Phieu_Thu"),
                    Chungtu_Goc    = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Chungtu_Goc"),
                    Id_Tiente      = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Id_Tiente"),
                    Lydo           = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Lydo"),
                    Ma_Doituong    = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Ma_Doituong"),
                    Ma_Kho_Hanghoa = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Ma_Kho_Hanghoa"),
                    Ngay_Chungtu   = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Ngay_Chungtu"),
                    Nguoi_Nop      = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Nguoi_Nop"),
                    Sochungtu      = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Sochungtu"),
                    Sotien         = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Sotien"),
                    Sotien_Quydoi  = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Sotien_Quydoi"),
                    Tygia          = gvBar_Rent_Reserve_Phieuthu.GetFocusedRowCellValue("Tygia"),
                };
                _Frmbar_Rent_Reserve_Phieu_Thu.barSystem.Visible = false;
                _Frmbar_Rent_Reserve_Phieu_Thu.Icon            = GoobizFrame.Windows.MdiUtils.ThemeSettings.GetProductIcon();
                _Frmbar_Rent_Reserve_Phieu_Thu.WindowState     = System.Windows.Forms.FormWindowState.Normal;
                _Frmbar_Rent_Reserve_Phieu_Thu.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
                _Frmbar_Rent_Reserve_Phieu_Thu.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
                //_Frmbar_Rent_Reserve_Phieu_Thu.ChangeFormState(GoobizFrame.Windows.Forms.FormState.Edit);
                _Frmbar_Rent_Reserve_Phieu_Thu.PerformEdit();
                _Frmbar_Rent_Reserve_Phieu_Thu.ShowDialog();
                dsBar_Rent_Reserve_Phieuthu            = objBarService.Get_All_Bar_Rent_Reserve_Phieuthu(Current_Guid_Reserve).ToDataSet();
                dgBar_Rent_Reserve_Phieuthu.DataSource = dsBar_Rent_Reserve_Phieuthu.Tables[0];
                //var SelectedObject = _Frmbar_Rent_Reserve_Phieu_Thu.GetType().GetProperty("SelectedWare_Phieu_Thu").GetValue(_Frmbar_Rent_Reserve_Phieu_Thu, null)
                //as Ecm.WebReferences.WareService.Ware_Phieu_Thu;

                //if (SelectedObject != null)
                //{
                //    gvBar_Rent_Reserve_Phieuthu.SetFocusedRowCellValue("Lydo", SelectedObject.Lydo);
                //    gvBar_Rent_Reserve_Phieuthu.SetFocusedRowCellValue("Sotien", SelectedObject.Sotien);
                //    gvBar_Rent_Reserve_Phieuthu.SetFocusedRowCellValue("Id_Tiente", SelectedObject.Id_Tiente);
                //}
            }
        }