Example #1
0
        /// <summary>
        /// Collecting the log record of the order 
        /// </summary>
        /// <param name="p_orderID"></param>
        /// <returns></returns>
        public CResult GetOrderLogInformation(Int64 p_orderID)
        {
            try
            {
                OrderLogInformation tempOrderLogInfo = new OrderLogInformation();
                m_oResult= Database.Instance.OrderInfo.GetOrderLogInformation(p_orderID);
                m_oResult.IsSuccess = true;
                m_oResult.Message = "Data Read Successfully";
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception occuer at GetOrderLogInformation() : " + ex.Message);
                m_oResult.IsException = true;
                m_oResult.Action = EERRORNAME.EXCEPTION_OCCURE;

                m_oResult.Message = ex.Message;
                Logger.Write("Exception : " + ex + " in GetOrderLogInformation()", LogLevel.Error, "CCustomerManager");
            }
            return m_oResult;
        }
Example #2
0
        private OrderLogInformation ConvertLogInfo(IDataReader oReader, Int64 orderID)
        {
            OrderLogInformation tempOrderLogInfo = new OrderLogInformation();

                tempOrderLogInfo.OrderID = orderID;
                tempOrderLogInfo.FirstOrderTakenTime = Convert.ToInt64("0" + oReader["item_order_time"]);
                tempOrderLogInfo.FirstOrderPrintTime = Convert.ToInt64("0" + oReader["send_kitchen_time"]);
                tempOrderLogInfo.UserName = Convert.ToString(oReader["user_name"]);
                tempOrderLogInfo.BillPrintStatus = Convert.ToInt32("0" + oReader["guest_bill_print_status"]);

                tempOrderLogInfo.UserID = Convert.ToInt32("0" + oReader["user_id"]);

            return tempOrderLogInfo;
        }
Example #3
0
 CResult IOrderInfoDAO.GetOrderLogInformation(long orderID)
 {
     CResult objResult = new CResult();
     List<OrderLogInformation> tempOrderLogInfoList = new List<OrderLogInformation>();
     int counter = 0;
     try
     {
         this.OpenConnection();
         string sqlCommand = String.Format(SqlQueries.GetQuery(Query.GetOrderLogInformation), orderID);
         IDataReader oReader = this.ExecuteReader(sqlCommand);
         if (oReader != null)
         {
             while (oReader.Read())
             {
                 OrderLogInformation tempObject = new OrderLogInformation();
                 tempObject = ConvertLogInfo(oReader, orderID);
                 tempOrderLogInfoList.Add(tempObject);
                 counter++;
             }
             objResult.Data = tempOrderLogInfoList;
         }
     }
     catch (Exception ex)
     {
         Console.Write("###" + ex.ToString() + "###");
         Logger.Write("Exception : " + ex + " in GetOrderLogInformation()", LogLevel.Error, "Database");
         if (ex.GetType().Equals(typeof(SqlException)))
         {
             SqlException oSQLEx = ex as SqlException;
             if (oSQLEx.Number != 7619)
                 throw new Exception("Exception occured at GetOrderLogInformation()", ex);
         }
         else
         {
             throw new Exception("Exception occure at GetOrderLogInformation()", ex);
         }
     }
     finally
     {
         this.CloseConnection();
     }
     return objResult;
 }
Example #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="oReader"></param>
 /// <returns></returns>
 private OrderLogInformation ConvertKitchenTextInfo(IDataReader oReader)
 {
     OrderLogInformation tempOrderLogInfo = new OrderLogInformation();
     tempOrderLogInfo.KitchenText = Convert.ToString(oReader["kitchen_text"]);
     tempOrderLogInfo.KitchenTextPrintStatus = Convert.ToInt32("0" + oReader["print_status"]);
     return tempOrderLogInfo;
 }