Пример #1
0
        private void frmActionGroupTour_Load(object sender, EventArgs e)
        {
            if (_WorkID == 1)
            {
                btnCancel.Text = "Hủy bỏ";
            }
            else
            {
                btnCancel.Text = "Hoàn tác";
            }

            _objectBook        = bookService.GetByID(_ObjID);
            dtpStartDate.Value = _objectBook.StartDate.Value;

            cbbGroupTourID.DataSource    = grTourService.GetListCombobox();
            cbbGroupTourID.ValueMember   = "GroupID";
            cbbGroupTourID.DisplayMember = "Name";

            cbbPartnerID.DataSource    = pnService.GetListCobobox();
            cbbPartnerID.ValueMember   = "PartnerID";
            cbbPartnerID.DisplayMember = "Address";

            Tour t = tService.GetByID((int)_objectBook.TourID);

            cbbGroupTourID.SelectedValue = t.GroupID;
            cbbPartnerID.SelectedValue   = _objectBook.PartnerID;
            cbbTourID.SelectedValue      = _objectBook.TourID;
            cbbPartnerID.SelectedValue   = _objectBook.PartnerID;

            numPax.Value     = (decimal)_objectBook.Pax.Value;
            txtSaleBook.Text = _objectBook.StaffID;

            //Tre em
            numPaxChild.Value    = (decimal)_objectBook.PaxChild.Value;
            txtPriceReChild.Text = _objectBook.PriceReChild.ToString();

            //txtCustomer.Text = _objectBook.CustomName;
            txtPickUp.Text = _objectBook.PickUp;
            txtRoom.Text   = _objectBook.Room;

            txtPriceRe.Text      = _objectBook.PriceReceive.ToString();
            txtPriceSa.Text      = _objectBook.PriceSale.ToString();
            txtPartnerPrice.Text = _objectBook.PartnerPrice.ToString();
            txtNote.Text         = _objectBook.Note;

            txtPromotionPrice.Text = _objectBook.PromotionMoney.ToString();
            lblTotalBookFinal.Text = _objectBook.Total.ToString();

            ckBookOK.Checked    = _objectBook.IsBooked.Value;
            ckIsPayment.Checked = _objectBook.IsPayment.Value;

            parseJsonServiceType(_objectBook.ServiceType);
            payment();
        }
        private DataTable GetRowsChecked()
        {
            var       tID  = cbbTourID.SelectedValue.ToString();
            Tour      t    = tService.GetByID(int.Parse(tID));
            DataTable data = new DataTable();

            data.Columns.Add("ID", typeof(int));
            data.Columns.Add("Pax", typeof(float));
            data.Columns.Add("PaxChild", typeof(float));
            data.Columns.Add("PickUp");
            data.Columns.Add("Room");
            data.Columns.Add("ServiceName");
            data.Columns.Add("PartnerPrice", typeof(int));
            data.Columns.Add("Note");
            for (int i = 0; i < gridViewData.SelectedRowsCount; i++)
            {
                var a = gridViewData.GetSelectedRows()[i];
                if (gridViewData.GetSelectedRows()[i] > -1)
                {
                    DataRow dr = data.NewRow();
                    dr["ID"]           = int.Parse(gridViewData.GetRowCellValue(a, "ID").ToString());
                    dr["Pax"]          = float.Parse(gridViewData.GetRowCellValue(a, "Pax").ToString());
                    dr["PaxChild"]     = float.Parse(gridViewData.GetRowCellValue(a, "PaxChild").ToString());
                    dr["PickUp"]       = gridViewData.GetRowCellValue(a, "PickUp").ToString() + " (" + t.Name + ")";
                    dr["Room"]         = gridViewData.GetRowCellValue(a, "Room").ToString();
                    dr["ServiceName"]  = gridViewData.GetRowCellValue(a, "ServiceName").ToString();
                    dr["PartnerPrice"] = int.Parse(gridViewData.GetRowCellValue(a, "PartnerPrice").ToString());
                    dr["Note"]         = gridViewData.GetRowCellValue(a, "Note").ToString();
                    data.Rows.Add(dr);
                }
            }
            return(data);
        }
 public frmActionTour(int action = -1, int objID = -1)
 {
     InitializeComponent();
     _action     = action;
     _objID      = objID;
     _objectData = gtService.GetByID(objID);
 }
Пример #4
0
        private void frmActionGroupTour_Load(object sender, EventArgs e)
        {
            txtPriceRe.Focus();

            cbbGroupPartner.DataSource    = groupService.GetList();
            cbbGroupPartner.ValueMember   = "GroupPartnerID";
            cbbGroupPartner.DisplayMember = "GroupName";

            cbbGroupTour.DataSource    = grTourService.GetListCombobox();
            cbbGroupTour.ValueMember   = "GroupID";
            cbbGroupTour.DisplayMember = "Name";

            if (_action == -1)
            {
                this.Text = "Thêm mới giá nhận theo tour";
            }
            else
            {
                this.Text = "Cập nhật giá nhận theo tour";
            }

            if (_objectData != null)
            {
                txtPriceRe.Text               = _objectData.PriceRe.ToString();
                txtPriceReChild.Text          = _objectData.PriceReChild.ToString();
                cbbGroupPartner.SelectedValue = _objectData.GroupID;
                Tour t = tourService.GetByID((int)_objectData.TourID);
                cbbGroupTour.SelectedValue = t.GroupID;
            }
        }
Пример #5
0
        private void cbbTourID_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                int    gID       = int.Parse(cbbGroupTourID.SelectedValue.ToString());
                int    id        = int.Parse(cbbTourID.SelectedValue.ToString());
                int    partnerID = int.Parse(cbbPartnerID.SelectedValue.ToString());
                string date1     = dtpStartDate.Value.ToString("yyyy-MM-dd");
                Tour   tour      = tService.GetByID(id);
                txtPriceSa.Text      = tour.PriceSale.ToString();
                txtPriceSaChild.Text = tour.PriceSaleChild.ToString();
                txtPriceRe.Text      = priceService.GetPriceForPartner(partnerID, id);

                //Load
                LoadNewData();
            }
            catch { }
        }
        private void frmActionGroupTour_Load(object sender, EventArgs e)
        {
            _objectBook        = bookService.GetByID(_ObjID);
            dtpStartDate.Value = _objectBook.StartDate.Value;

            cbbGroupTourID.DataSource    = grTourService.GetListCombobox();
            cbbGroupTourID.ValueMember   = "GroupID";
            cbbGroupTourID.DisplayMember = "Name";

            cbbTourID.DataSource    = tService.GetListCobobox();
            cbbTourID.ValueMember   = "TourID";
            cbbTourID.DisplayMember = "Name";

            cbbPartnerID.DataSource    = pnService.GetList();
            cbbPartnerID.ValueMember   = "PartnerID";
            cbbPartnerID.DisplayMember = "Address";

            Tour t = tService.GetByID((int)_objectBook.TourID);

            cbbGroupTourID.SelectedValue = t.GroupID;
            cbbTourID.SelectedValue      = _objectBook.TourID;
            cbbPartnerID.SelectedValue   = _objectBook.PartnerID;

            numPax.Value     = (decimal)_objectBook.Pax.Value;
            txtSaleBook.Text = _objectBook.StaffID;

            txtCustomer.Text = _objectBook.CustomName;
            txtPickup.Text   = _objectBook.PickUp == "" ? cbbPartnerID.SelectedText : _objectBook.PickUp;
            txtRoom.Text     = _objectBook.Room;

            txtPriceRe.Text = _objectBook.PriceReceive.ToString();
            txtPriceSa.Text = _objectBook.PriceSale.ToString();

            txtPartnerPrice.Text = _objectBook.PartnerPrice.ToString();

            txtPromotionPrice.Text = _objectBook.PromotionMoney.ToString();
            lblTotalBook.Text      = _objectBook.Total.ToString();

            parseJsonServiceType(_objectBook.ServiceType);

            ckIsPayment.Checked = _objectBook.IsPayment.Value;
            ckBookOK.Checked    = _objectBook.IsBooked.Value;
        }
        public frmDetailsBookCar(DataTable dt, int numCar, int tourID, string startDate)
        {
            InitializeComponent();
            _dataTemp  = dt;
            _tourID    = tourID;
            _startDate = DateTime.Parse(startDate);
            Tour t = tourService.GetByID(tourID);

            lblTour.Text = t.Name;
            lblDate.Text = _startDate.ToString("dd-MMM");
            _tourName    = t.Name;
            _numCar      = numCar;
            this.Text    = "Chi tiết xe " + numCar;
            btnPrint.UseVisualStyleBackColor = true;
        }
        public frmDetailsPrintAgain(int PrintID, int tourID, string startDate, int guide1, string guide2, int driver1, string driver2, string carcode)
        {
            InitializeComponent();
            cbbHDV.DataSource    = staffService.GetStaffHDV();
            cbbHDV.DisplayMember = "Name";
            cbbHDV.ValueMember   = "ID";

            cbbTaiXe.DataSource    = staffService.GetStaffTaiXe();
            cbbTaiXe.DisplayMember = "Name";
            cbbTaiXe.ValueMember   = "ID";

            this.Text   = "Chi tiết xe " + carcode;
            txtBKS.Text = carcode;
            _TourID     = tourID;
            Tour t = tourService.GetByID(_TourID);

            lblTour.Text               = t.Name;
            lblDate.Text               = startDate;
            cbbHDV.SelectedValue       = guide1;
            txtHdvName.Text            = guide2;
            cbbTaiXe.SelectedValue     = driver1;
            txtTXName.Text             = driver2;
            gridControlData.DataSource = printDetailService.GetList(PrintID);
        }