private void button1_Click(object sender, EventArgs e) { double imageWidth, cPrice = 0; if (double.TryParse(textBox1.Text, out imageWidth)) { cPrice = imageWidth; } if (cPrice > 0) { StockMgntRef.StockMgntClient client = new StockMgntRef.StockMgntClient(); var msg = client.SetCylPrice(selectedCy.CylinderType, cPrice); if (msg.Equals("OK")) { MessageBox.Show("Successfully Updated Price of Product '" + selectedCy.CylinderType + "' . New price is " + cPrice + " Rs."); } cylinders = client.GetCylinders().ToList(); } else { textBox2.Text = cPrice.ToString(); MessageBox.Show("Invalid Price!!!"); } textBox1.Text = ""; comboBox1.Items.Clear(); string[] cyTypes = cylinders.Where(x => x.Price != 0).Select(x => x.CylinderType).ToArray(); comboBox1.Items.AddRange(cyTypes); }
private void AddCylinder_Load(object sender, EventArgs e) { Location = new Point(-7, 50); int w = SystemInformation.VirtualScreen.Width + 14; int h = SystemInformation.VirtualScreen.Height - 43; Size = new Size(w, h); dataGridView1.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 10); using (StockMgntRef.StockMgntClient client = new StockMgntRef.StockMgntClient()) { dataGridView1.DataSource = client.GetCylinders(); cylinders = client.GetCylinders().ToList(); string[] cyTypes = cylinders.Where(x => x.Price != 0).Select(x => x.CylinderType).ToArray(); comboBox1.Items.AddRange(cyTypes); } }
private void button1_Click(object sender, EventArgs e) { StockMgntRef.StockMgntClient client = new StockMgntRef.StockMgntClient(); TransactionMgnt.TransactionMgntClient client1 = new TransactionMgnt.TransactionMgntClient(); var fr = client.SetFCylinders(selectedFType, int.Parse(textBox1.Text)); var er = client.SetECylinders(selectedEType, int.Parse(textBox1.Text)); var msg1 = client1.AddCylenderTx(comboBox1.Text, int.Parse(textBox1.Text)); if (fr.Equals("OKF") && er.Equals("OKE") && msg1.Equals("OK")) { MessageBox.Show("Stock is Updated"); } cylinders = client.GetCylinders().ToList(); dataGridView1.DataSource = cylinders; textBox1.Text = ""; }
private void ViewStock_Load(object sender, EventArgs e) { Location = new Point(-7, 50); int w = SystemInformation.VirtualScreen.Width + 14; int h = SystemInformation.VirtualScreen.Height - 43; Size = new Size(w, h); dataGridView1.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 10); dataGridView2.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 10); using (StockMgntRef.StockMgntClient client = new StockMgntRef.StockMgntClient()) { dataGridView1.DataSource = client.GetCylinders(); dataGridView2.DataSource = client.GetStoves(); var reg = client.GetRegulators(); label3.Text += reg.Quentity + " piece(s)"; label5.Text += reg.Price + " Rs."; } }
private void SetPrice_Load(object sender, EventArgs e) { Location = new Point(-7, 50); int w = SystemInformation.VirtualScreen.Width + 14; int h = SystemInformation.VirtualScreen.Height - 43; Size = new Size(w, h); using (StockMgntRef.StockMgntClient client = new StockMgntRef.StockMgntClient()) { cylinders = client.GetCylinders().ToList(); string[] cyTypes = cylinders.Where(x => x.Price != 0).Select(x => x.CylinderType).ToArray(); comboBox1.Items.AddRange(cyTypes); stoves = client.GetStoves().ToList(); string[] stoveTypes = stoves.Where(x => x.Price != 0).Select(x => x.Product).ToArray(); comboBox2.Items.AddRange(stoveTypes); var reg = client.GetRegulators(); textBox3.Text = reg.Price.ToString(); } }