public static TomarUnidadMedidas tomarUnidadMedidas() { var httpWebRequest = (HttpWebRequest)WebRequest.Create(pagina + "tomarUnidadMedidas.php"); httpWebRequest.ContentType = "application/json"; httpWebRequest.Method = "POST"; using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream())) { string json = new JavaScriptSerializer().Serialize(new Producto() { }); streamWriter.Write(json); } var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); // MessageBox.Show(result,"Resultado"); TomarUnidadMedidas tum = JsonConvert.DeserializeObject <TomarUnidadMedidas>(result); //MessageBox.Show(rj.estado + "", rj.msg); return(tum); } }
public AgregarProducto() { InitializeComponent(); /*this.WindowState = FormWindowState.Maximized; * this.dataGridView2.SetBounds(dataGridView2.Bounds.X,dataGridView2.Bounds.Y+10, this.Bounds.Width,this.Bounds.Height-10); * this.panel1.SetBounds(dataGridView2.Bounds.X, dataGridView2.Bounds.Y, this.Bounds.Width+15, this.Bounds.Height+50); * this.panel2.Location = new Point(panel1.Width+10,panel1.Location.Y); * this.textBox4.Location = new Point(this.panel1.Location.X + 50, this.panel1.Height - 30 ); * this.label5.Location = new Point(this.panel1.Location.X, this.panel1.Height - 30);*/ tp = StaticsFunctions.tomarProds(); tum = StaticsFunctions.tomarUnidadMedidas(); var list = new BindingList <GVProducto>(mandarProductosGV(tp.productos)); dataGridView2.DataSource = list; this.CenterToScreen(); textBox5.AutoCompleteMode = AutoCompleteMode.Suggest; textBox5.AutoCompleteSource = AutoCompleteSource.CustomSource; AutoCompleteStringCollection col = new AutoCompleteStringCollection(); col.Add("12171500"); col.Add("53131600"); col.Add("52141700"); textBox5.AutoCompleteCustomSource = col; agregarUnidadesMedida(); agregarProveedores(); /*DataGridViewColumn column = dataGridView2.Columns[0]; * column.Width = 160;*/ }
public AgregarServicio() { InitializeComponent(); this.CenterToScreen(); tum = StaticsFunctions.tomarUnidadMedidas(); agregarUnidadesMedida(); reiniciarGridView(); comboBox1.SelectedIndex = 2; }