Beispiel #1
0
        private void cmbServicio_SelectedIndexChanged(object sender, EventArgs e)
        {
            Workshopsvc workshopsvc = new Workshopsvc();
            string      json        = workshopsvc.readById(cmbServicio.SelectedValue.ToString());

            workshopsvc       = JsonConvert.DeserializeObject <Workshopsvc>(json.Replace("_id", "id"));
            txtDescWork.Text  = workshopsvc.Description;
            txtCostoWork.Text = workshopsvc.Cost;
        }
Beispiel #2
0
        public void SelectedWorkshopsvc(Workshopsvc selectedworkshopsvc)
        {
            //saledetailsvcgral = new Detalleventasvc();
            saledetailsvcgral.Idworkshopsvc = selectedworkshopsvc.Id;
            saledetailsvcgral.Price         = txtCostoWork.Text = selectedworkshopsvc.Cost;

            txtDescWork.Text = selectedworkshopsvc.Description;

            cmbServicio.SelectedValue = saledetailsvcgral.Idworkshopsvc;
        }
Beispiel #3
0
 private void btnPrnuevo_Click(object sender, EventArgs e)
 {
     workshopsvc           = new Workshopsvc();
     txtPrnumero.Text      = "";
     txtPrdescripcion.Text = "";
     txtPrcosto.Text       = "";
     txtPrfiltro.Text      = "";
     gbDatosForm.Enabled   = true;
     btnGuardar.Enabled    = true;
     gbDatosGrid.Enabled   = false;
 }
Beispiel #4
0
        private void seleccionar(int i)
        {
            if (dataGrid.CurrentRow == null)
            {
                return;
            }
            int             selectedrowindex = i;
            DataGridViewRow selectedRow      = dataGrid.Rows[selectedrowindex];
            Workshopsvc     workshopsvc      = new Workshopsvc();

            workshopsvc.Id          = Convert.ToString(selectedRow.Cells["_id"].Value);;
            workshopsvc.Description = Convert.ToString(selectedRow.Cells["description"].Value);
            workshopsvc.Cost        = Convert.ToString(selectedRow.Cells["cost"].Value);
            _caller.SelectedWorkshopsvc((Workshopsvc)workshopsvc);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Beispiel #5
0
        private void loadComboboxWorkshopsvc()
        {
            Workshopsvc        workshopsvc = new Workshopsvc();
            string             json        = workshopsvc.read();
            List <Workshopsvc> x           = JsonConvert.DeserializeObject <List <Workshopsvc> >(json.Replace("_id", "id"));

            if (!json.Equals("[]"))
            {
                Dictionary <String, String> datasource = new Dictionary <string, string>();
                foreach (Workshopsvc p in x)
                {
                    datasource.Add(p.Id, p.Description);
                }
                cmbServicio.DataSource    = new BindingSource(datasource, null);
                cmbServicio.DisplayMember = "Value";
                cmbServicio.ValueMember   = "Key";
            }
        }