private void GetBindersType() { var bindersApi = new IO.Swagger.Api.BindersApi(Configuration); var types = bindersApi.BindersGetTypesOfPratiche(); bindersGrid.DataSource = types; }
private void GetBinderByType(int binderTypeId) { var bindersApi = new IO.Swagger.Api.BindersApi(Configuration); var binders = bindersApi.BindersGetByTypeAndState(binderTypeId, 0); bindersGrid.DataSource = binders; }
private void button23_Click(object sender, EventArgs e) { var binderApi = new IO.Swagger.Api.BindersApi(Configuration); if (bindersGrid.SelectedRows.Count == 0) { MessageBox.Show("Selezionare una pratica", "Attenzione", MessageBoxButtons.OK, MessageBoxIcon.Error); } int docnumberToAddInt; if (!int.TryParse(docnumberToAddBinder.Text, out docnumberToAddInt) || docnumberToAddInt == 0) { MessageBox.Show("Inserire un docnumber da aggiungere", "Attenzione", MessageBoxButtons.OK, MessageBoxIcon.Error); } binderApi.BindersAddProfilesToBinder(new BinderProfilesInsertRequest(new List <int?>() { docnumberToAddInt }, (bindersGrid.SelectedRows[0].DataBoundItem as BinderDTO).Id)); GetProfilesByBinder((bindersGrid.SelectedRows[0].DataBoundItem as BinderDTO).Id.Value); }
private void button22_Click(object sender, EventArgs e) { var bindersApi = new IO.Swagger.Api.BindersApi(Configuration); if (bindersGrid.SelectedRows.Count == 0 || (bindersGrid.SelectedRows[0].DataBoundItem as BinderTypeDTO) == null) { MessageBox.Show("Selezionare un tipo pratica in cui creare la nuova pratica"); } else { var name = Prompt.ShowDialog("Inserire il nome della nuova pratica", "Crea Pratica"); var number = Prompt.ShowDialog("Inserire il numero della nuova pratica", "Crea Pratica"); if (string.IsNullOrEmpty(name)) { MessageBox.Show("Creazione annullata, nome pratica obbligatorio"); } else { var binder = new BinderDTO() { BinderName = name, BinderState = 1, BinderTypeId = (bindersGrid.SelectedRows[0].DataBoundItem as BinderTypeDTO).Id, Code = number, User = 2, Fields = new List <FieldBaseDTO>() }; bindersApi.BindersInsertNewBinder(binder); var binderType = (BinderTypeDTO)bindersGrid.SelectedRows[0].DataBoundItem; GetBinderByType(((BinderTypeDTO)bindersGrid.SelectedRows[0].DataBoundItem).Id.Value); } } }