Пример #1
0
        private void cbFilingCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            optionalServices = new List <OptionalServiceDTO>();
            dynamic codes = AppConstants.ApiCaller.get("/code/optional_service_codes?location_code="
                                                       + _create.LocationCode + "&filing_code=" + (cbFilingCode.SelectedItem as dynamic).code);

            foreach (var item in codes["items"])
            {
                var service = new OptionalServiceDTO()
                {
                    Code = item["code"],
                    Name = item["name"]
                };
                optionalServices.Add(service);
            }
            RefreshOptionalServices();

            cbSecurity.Items.Clear();

            dynamic docTypes = AppConstants.ApiCaller.get("/code/document_type_codes?location_code=" + _create.LocationCode + "&filing_code=" + (cbFilingCode.SelectedItem as dynamic).code);

            foreach (var item in docTypes["items"])
            {
                cbSecurity.Items.Add(new { name = item["name"], code = item["code"] });
            }
        }
 public frmAddOptionalService(OptionalServiceDTO optional, frmAddFiling frm)
 {
     InitializeComponent();
     txtOptional.Text  = optional.Name;
     txtQuantity.Value = optional.Quantity;
     _optional         = optional;
     _frm = frm;
 }
Пример #3
0
        public void UpdateService(OptionalServiceDTO service)
        {
            var existing = selectedServices.FirstOrDefault(x => x.Code == service.Code);

            if (existing != null)
            {
                existing.Quantity = service.Quantity;
            }
            RefreshSelectedServices();
        }
Пример #4
0
 public void AddService(OptionalServiceDTO optional)
 {
     selectedServices.Add(optional);
     RefreshSelectedServices();
 }