Beispiel #1
0
        /// <summary>
        ///This method converts the reader object to the data object        
        /// </summary>
        /// <param name="oReader"></param>
        /// <returns></returns>
        private COrderShow ReaderToOrderShow(IDataReader oReader)
        {
            COrderShow oOrderShow = new COrderShow();

            if (oReader["order_id"] != null)
            {
                oOrderShow.OrderID = Int64.Parse(oReader["order_id"].ToString());
            }

            if (oReader["order_type"] != null)
            {
                oOrderShow.OrderType = oReader["order_type"].ToString();
            }

            if (oReader["status"] != null)
            {
                oOrderShow.Status = oReader["status"].ToString();
            }

            if (oReader["guest_count"] != null)
            {
                oOrderShow.GuestCount = int.Parse(oReader["guest_count"].ToString());
            }

            if (oReader["table_number"] != null)
            {
                oOrderShow.TableNumber = Int64.Parse(oReader["table_number"].ToString());
            }

            if (oReader["table_name"] != null)
            {
                oOrderShow.TableName = oReader["table_name"].ToString();
            }

            if (oReader["user_name"] != null)
            {
                oOrderShow.UserName = oReader["user_name"].ToString();
            }

            try
            {
                if (oReader["FloorNo"] != null)
                {
                    oOrderShow.FloorNo = oReader["FloorNo"].ToString();
                }
            }
            catch (Exception)
            {
            }

            if (oReader["online_orderid"] != null)
            {
                oOrderShow.OnlineOrderID = Convert.ToInt64("0" + oReader["online_orderid"]); //Online order status .i.e whether it came from online or local order. If 1 then come from online otherwise local order
            }
            return oOrderShow;
        }
Beispiel #2
0
        private COrderShow ReaderToReportOrderShow(IDataReader oReader)
        {
            COrderShow oOrderShow = new COrderShow();

            if (oReader["order_id"] != null)
                oOrderShow.OrderID = Int64.Parse(oReader["order_id"].ToString());

            if (oReader["order_type"] != null)
                oOrderShow.OrderType = oReader["order_type"].ToString();

            if (oReader["table_number"] != null)
                oOrderShow.TableNumber = int.Parse(oReader["table_number"].ToString());

            return oOrderShow;
        }
Beispiel #3
0
        /// <summary>
        ///This method converts the reader object to the data object        
        /// </summary>
        /// <param name="oReader"></param>
        /// <returns></returns>
        private COrderShow ReaderToOrderShow(IDataReader oReader)
        {
            COrderShow oOrderShow = new COrderShow();

            if (oReader["order_id"] != null)
                oOrderShow.OrderID = Int64.Parse(oReader["order_id"].ToString());

            if (oReader["order_type"] != null)
                oOrderShow.OrderType = oReader["order_type"].ToString();

            if (oReader["status"] != null)
                oOrderShow.Status = oReader["status"].ToString();

            if (oReader["guest_count"] != null)
                oOrderShow.GuestCount = int.Parse(oReader["guest_count"].ToString());

            if (oReader["table_number"] != null)
                oOrderShow.TableNumber = int.Parse(oReader["table_number"].ToString());

            if (oReader["table_name"] != null)
                oOrderShow.TableName = oReader["table_name"].ToString();

            if (oReader["user_name"] != null)
                oOrderShow.UserName = oReader["user_name"].ToString();

            return oOrderShow;
        }