} //Done private bool DoSomeChecks() { if (PO_NO.Text.Equals("")) { MessageBox.Show("P.O # Can't Be Empty"); } else if (ShipTo.Text.Equals("")) { MessageBox.Show("ShipTo Can't Be Empty"); } else if (Vendor.Text.Equals("")) { MessageBox.Show("Vendor Can't Be Empty"); } else if (Delivery_dt.Text.Equals("")) { MessageBox.Show("Delivery Date Can't Be Empty"); } else if (ShipTo.Text.Equals("")) { MessageBox.Show("Ship to Kitchen Can't Be Empty"); } else if (ItemsDGV.Items.Count == 0) { MessageBox.Show("Items can not be empty"); } else { for (int i = 0; i < ItemsDGV.Items.Count; i++) { try { float.Parse((ItemsDGV.Items[i] as DataRowView).Row["Qty"].ToString()); } catch { MessageBox.Show("Qty input error"); ItemsDGV.CurrentCell = new DataGridCellInfo(ItemsDGV.Items[i], ItemsDGV.Columns[5]); //nb2a n3dl el index kol mara nezawd column ItemsDGV.BeginEdit(); return(false); } try { float.Parse((ItemsDGV.Items[i] as DataRowView).Row["Price"].ToString()); } catch { MessageBox.Show("Price input error"); ItemsDGV.CurrentCell = new DataGridCellInfo(ItemsDGV.Items[i], ItemsDGV.Columns[6]); //nb2a n3dl el index kol mara nezawd column ItemsDGV.BeginEdit(); return(false); } } return(true); } return(false); } //Done
} //Done private bool DoSomeChecks() { if (transfer_No.Text.Equals("")) { MessageBox.Show("Transfer No. Can't Be Empty"); } else if (Manual_transfer_No.Text.Equals("")) { MessageBox.Show("Manual Transfer No. Can't Be Empty"); } else if (Transfer_dt.Text.Equals("")) { MessageBox.Show("Transfer Date Can't Be Empty"); } //else if (Transfer_Time.Text == null) //{ // MessageBox.Show("Transfer Time Can't Be Empty"); //} else if (Statustxt.Text.Equals("")) { MessageBox.Show("Status Can't Be Empty"); } else if (From_Kitchen.Text.Equals("")) { MessageBox.Show("Choose a Resturant To Transfer From"); } else if (To_Kitchen.Text.Equals("")) { MessageBox.Show("Choose a Resturant To Transfer To"); } else if (ItemsDGV.Items.Count == 0) { MessageBox.Show("Items can not be empty"); } else { DataTable dt = ItemsDGV.DataContext as DataTable; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["Qty"].ToString() == "") { ItemsDGV.CurrentCell = new DataGridCellInfo(ItemsDGV.Items[i], ItemsDGV.Columns[4]); ItemsDGV.BeginEdit(); MessageBox.Show(string.Format("Qty Input of Item {0} is Null", i + 1)); return(false); } } return(true); } return(false); } //Done