示例#1
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;
            }
        }
        private void loadDataGroup()
        {
            objService = new PriceService();
            var data = objService.GetList();

            gridControlPrice.DataSource = data;
            gridControlPrice.Update();
            gridControlPrice.Refresh();

            gpService = new GroupPartnerService();
            gridControlDataPartner.DataSource = gpService.GetList();
            gridControlDataPartner.Update();
            gridControlDataPartner.Refresh();
        }
        private void frmActionGroupTour_Load(object sender, EventArgs e)
        {
            txtPartnerCode.Focus();

            cbbStatus.DataSource    = Constant.getListStatus();
            cbbStatus.ValueMember   = "ID";
            cbbStatus.DisplayMember = "Name";

            cbbGroupPartnerID.DataSource    = gpService.GetList();
            cbbGroupPartnerID.ValueMember   = "GroupPartnerID";
            cbbGroupPartnerID.DisplayMember = "GroupName";

            if (_action == -1)
            {
                this.Text = "Thêm mới đối tác";
            }
            else
            {
                this.Text = "Cập nhật đối tác";
            }

            if (_objectData != null)
            {
                txtPartnerCode.Text             = _objectData.PartnerCode;
                txtName.Text                    = _objectData.Name;
                txtSoNha.Text                   = _objectData.Line;
                txtAddress.Text                 = _objectData.Address;
                txtPhone.Text                   = _objectData.Phone;
                txtNote.Text                    = _objectData.Note;
                cbbStatus.SelectedValue         = _objectData.Status;
                cbbGroupPartnerID.SelectedValue = _objectData.GroupID;
            }
            else
            {
                //txtPartnerCode.Text = gtService.GetPartnerCode();
            }
        }