Advertisement
Advertisement
| 02.24.2008 at 07:58PM PST, ID: 23189316 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: |
public void ReadMakeLineAPI()
{
int id = -1;
SqlConnection conn = null;
SqlCommand dbSelectCommand1 = null;
SqlCommand dbSelectCommand2 = null;
SqlDataReader reader1 = null;
SqlDataReader reader2 = null;
string sql = null;
try
{
conn = new SqlConnection();
conn.ConnectionString = Handles.Preferences.MakeLineConnectionString;
conn.Open();
dbSelectCommand1 = new SqlCommand();
dbSelectCommand1.Connection = conn;
sql = "SELECT * FROM " + Configuration.GetConfig("MakeLineTable") + " WHERE StoreID='" + Handles.Restaurant.StoreID + "'";
dbSelectCommand1.CommandText = sql;
reader1 = dbSelectCommand1.ExecuteReader();
TLArrayList orderNumberList = new TLArrayList(Handles);
while (reader1.Read())
{
try
{
string orderNumber = reader1.GetString(reader1.GetOrdinal("OrderNum"));
Order order = GetOrderByID(orderNumber.TrimEnd(' '));
if (order != null)
{
if (reader1.GetString(reader1.GetOrdinal("Status")) == "MakeLine")
{
if (!reader1.IsDBNull(reader1.GetOrdinal("BumpTime")))
{
string bumpTimeStr = reader1.GetString(reader1.GetOrdinal("BumpTime"));
TLDateTime bumpTime = null;
if (Handles.IsEmulation || Handles.IsReplay)
{
bumpTime = new TLDateTime(Handles.Clock);
}
else
{
bumpTime = new TLDateTime(bumpTimeStr);
}
order.Bump(bumpTime, false);
orderNumberList.Add(orderNumber);
}
else
{
// check for an UmBump??
}
}
}
}
catch (Exception ex)
{
Handles.LogException("OrderList.ReadMakeLineAPI(1)", ex, sql + " failed record ID:" + id.ToString());
}
}
if (reader1 != null)
reader1.Close();
foreach (string orderNum in orderNumberList)
{
try
{
dbSelectCommand2 = new SqlCommand();
dbSelectCommand2.Connection = conn;
sql = "DELETE FROM " + Configuration.GetConfig("MakeLineTable") + " WHERE StoreID='" + Handles.Restaurant.StoreID + "' AND Status='" + OrderNode.GetOrderStatusStr(OrderNode.OrderStatus.MakeLine) + "' AND OrderNum='" + orderNum.TrimEnd(' ') + "'";
dbSelectCommand2.CommandText = sql;
reader2 = dbSelectCommand2.ExecuteReader();
}
catch (Exception ex)
{
Handles.LogException("OrderList.ReadMakeLineAPI(2)", ex, sql);
}
}
}
catch (Exception ex)
{
Handles.LogException("OrderList.ReadMakeLineAPI(3)", ex, sql);
}
finally
{
if (reader1 != null)
reader1.Close();
if (dbSelectCommand1 != null)
dbSelectCommand1.Dispose();
if (reader2 != null)
reader2.Close();
if (dbSelectCommand2 != null)
dbSelectCommand2.Dispose();
if (conn != null)
{
conn.Close();
conn.Dispose();
}
}
}
|