private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { OrderDelivered o1 = new OrderDelivered(); if (e.ColumnIndex == 11) { DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex]; o1.orderid = int.Parse(row.Cells["orderIdDataGridViewTextBoxColumn"].Value.ToString()); OrderDetails OD = new OrderDetails(); this.Hide(); OD.Show(); } if (e.ColumnIndex == 12) { DialogResult Result = MessageBox.Show("Are you sure to delete order", "Delete order", MessageBoxButtons.YesNo); if (Result == DialogResult.Yes) { DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex]; o1.orderid = int.Parse(row.Cells["orderIdDataGridViewTextBoxColumn"].Value.ToString()); /*OrderDetails OD = new OrderDetails(); this.Hide(); OD.Show();*/ deleteorder(o1.orderid); deletedetailsfromOrderDetails(o1.orderid); } } }
public void AddtoOrderList() { try { SqlConnection con = new SqlConnection(Program.CONSTR); con.Open(); OrderDelivered od = new OrderDelivered(); int ORDERID = od.orderid; //is se orderid ayegi GetCustomername(ORDERID); //is se customer name ayega getitemid_name_unitprice();// is se 3 chezen ayegi /* GetOrderDetailid(); ChecksGetOrderDetailid();*/ int ORDERDETAILID = orderdetailid;//is se order detail id ayegi int QUANTITY = int.Parse(AddNeworder_Quantity.Text); //is se quantity ajagi double TOTALPRICE = double.Parse(AddnewOrder_Amount.Text); // is se total price ajaig //"INSERT INTO TIMINGS(Id, CheckInTime, CheckOutTime, Date) Values(" + teacherId.Text + ",'" + varCheckIn + "','" + varCheckOut + "','" + date.Text + "')"; string query = "INSERT INTO OrderDetails( OrderId ,Name,Itemid,ItemName,UnitPrice,Quantity,TotalPrice ) Values (" + ORDERID + " , '" + customername + "' , " + fooditemid + " ,'" + fooditemname + "' , " + foodunitprice + " , " + QUANTITY + " ," + TOTALPRICE + ")"; SqlCommand sc = new SqlCommand(query, con); sc.ExecuteNonQuery(); con.Close(); MessageBox.Show("Add Successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
public void ChecksOrderidValidorInvalid(int Searchorderid) { int temp = 0; int count = 0; SqlConnection con = new SqlConnection(Program.CONSTR); con.Open(); string query = "select Orders.OrderId from Orders"; SqlCommand sc = new SqlCommand(query, con); SqlDataReader sd = sc.ExecuteReader(); if (sd.HasRows) { while (sd.Read()) { temp = sd.GetInt32(0); if (temp == Searchorderid) { OrderDelivered od = new OrderDelivered(); od.orderid = int.Parse(SearchByorderid_EnterOrderid.Text); OrderDetails OR = new OrderDetails(); this.Hide(); OR.Show(); count = 1; } } if (count==0) { MessageBox.Show("Order Id not Founded"); } } }
private void button1_Click(object sender, EventArgs e) { OrderDelivered n = new OrderDelivered(); int Orderid = n.orderid; SetStatusOfItemdelivered(Orderid); SetStatusOfIteminPending(Orderid); setOrderStatus(Orderid); SetComments(Orderid); MessageBox.Show("Changes Successfully made "); }
private void AddNewOrder_Load(object sender, EventArgs e) { OrderDelivered od = new OrderDelivered(); Addneworder_orderid.Text = od.orderid.ToString(); /*GetOrderDetailid(); * ChecksGetOrderDetailid();*/ getCategoriesnames(); }
private void OrderDetails_Load(object sender, EventArgs e) { credentials(); OrderDelivered n = new OrderDelivered(); int Orderid = n.orderid; GetCustomerdetails(Orderid); GetItemsDetails(Orderid); Gettotalwithrespectivetoquantity(Orderid); GetTotalPrice(Orderid); }
private void orderDeliveredToolStripMenuItem_Click(object sender, EventArgs e) { OrderDelivered Od = new OrderDelivered(); this.Hide(); Od.Show(); }
private void AddNewOrder_Load(object sender, EventArgs e) { OrderDelivered od = new OrderDelivered(); Addneworder_orderid.Text = od.orderid.ToString(); /*GetOrderDetailid(); ChecksGetOrderDetailid();*/ getCategoriesnames(); }
private void orderInProgressToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); OrderDelivered o1 = new OrderDelivered(); o1.Show(); }
private void button3_Click(object sender, EventArgs e) { OrderDelivered od = new OrderDelivered(); this.Hide(); od.Show(); }
private void Proceed_Click(object sender, EventArgs e) { OrderDelivered od = new OrderDelivered(); od.orderid = int.Parse(SearchByorderid_EnterOrderid.Text); ChecksOrderidValidorInvalid(od.orderid); }
private void button1_Click(object sender, EventArgs e) { OrderDelivered od = new OrderDelivered(); int orderid = od.orderid; FetchingOrderDetailid(orderid); }
private void DeleteItem_Load(object sender, EventArgs e) { OrderDelivered od = new OrderDelivered(); int orderid= od.orderid; GetItemsDetails(orderid); }