Exemplo n.º 1
0
        public CResult UpdateButtonColor(RMS.Common.ObjectModel.CButtonColor inUser)
        {
            CResult oResult = new CResult();

            try
            {
                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.UpdateButtonColor), inUser.ButtonColor, inUser.ButtonID, inUser.CurrentUserId, inUser.LoginDateTime);

                this.ExecuteNonQuery(sSql);

                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at ItemInsert()", ex);
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 2
0
        public CResult Cat1Delete(RMS.Common.ObjectModel.CCategory1 oCat)
        {
            CResult objResult = new CResult();

            try
            {
                this.OpenConnection();
                string sSql = string.Format(SqlQueries.GetQuery(Query.DeleteCategory1), oCat.Category1ID);
                this.ExecuteNonQuery(sSql);

                objResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemDelete()", LogLevel.Error, "Database");
                objResult.Message = ex.Message;
                objResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }

            return objResult;
        }
Exemplo n.º 3
0
        public CResult InsertDelivery(CDelivery inDelivery)
        {
            CResult oResult = new CResult();

            try
            {

                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.InsertDelivery),inDelivery.DeliveryOrderID,inDelivery.DeliveryTime);
                this.ExecuteNonQuery(sSql);

                oResult.IsSuccess = true;
            }

            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in InsertDeposit()", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at OrderDetailsInsert()", ex);
                oResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }

            return oResult;
        }
Exemplo n.º 4
0
        public CResult UpdatePrintStyle(CPrintStyle inUser)
        {
            CResult oResult = new CResult();

            try
            {
                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.UpdatePrintStyle), inUser.Header, inUser.Body, inUser.Footer, inUser.StyleID);

                this.ExecuteNonQuery(sSql);

                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database");

                oResult.IsException = true;

                //throw new Exception("Exception occure at ItemInsert()", ex);
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 5
0
        public CResult AddButtonColor(RMS.Common.ObjectModel.CButtonColor inUser)
        {
            CResult oResult = new CResult();

            inUser.ButtonName = inUser.ButtonName.Replace("''", "'");
            inUser.ButtonName = inUser.ButtonName.Replace("'", "''");
            try
            {
                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.AddButtonColor), inUser.ButtonName, inUser.ButtonColor, RMSGlobal.LogInUserName, DateTime.Now.Ticks);

                this.ExecuteNonQuery(sSql);

                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at ItemInsert()", ex);
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 6
0
        public CResult GetButtonColor(RMS.Common.ObjectModel.CButtonColor inCat)
        {
            CResult oResult = new CResult();
            try
            {
                this.OpenConnection();
                string sSql = string.Format(SqlQueries.GetQuery(Query.GetButtonColor), inCat.ButtonID);
                IDataReader oReader = this.ExecuteReader(sSql);
                if (oReader != null)
                {
                    if (oReader.Read())
                    {
                        inCat = ReaderToButtonColor(oReader);

                        oResult.Data = inCat;

                        oResult.IsSuccess = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemGetById()", LogLevel.Error, "Database");

                oResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 7
0
        public CResult AddUser(CUserInfo inUser)
        {
            CResult oResult = new CResult();

            try
            {
                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.AddUser), inUser.UserName, inUser.Password, inUser.Type, inUser.Status, inUser.Gender);

                this.ExecuteNonQuery(sSql);

                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at ItemInsert()", ex);
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 8
0
        public CResult Cat2Delete(CCategory2 oCat)
        {
            CResult oResult = new CResult();

            try
            {
                this.OpenConnection();
                string sSql = string.Format(SqlQueries.GetQuery(Query.DeleteCategory2), oCat.Category2ID);
                this.ExecuteNonQuery(sSql);

                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemDelete()", LogLevel.Error, "Database");

                throw new Exception("Exception occure at ItemDelete()", ex);
            }
            finally
            {
                this.CloseConnection();
            }

            return oResult;
        }
Exemplo n.º 9
0
        public CResult GetDrawerLogDetails(Int64 startTime, Int64 endTime)
        {
            CResult tempcResult = new CResult();
            List<CPayment> paymentdetails = new List<CPayment>();
            string sqlCommand = String.Format(SqlQueries.GetQuery(Query.DrawerLogdetails), startTime, endTime);
            IDataReader oReader = this.ExecuteReader(sqlCommand);
            if (oReader != null)
            {
                while (oReader.Read())
                {
                    CPayment tempPayment = new CPayment();

                    if (oReader["terminal_id"] != null)
                    {
                        tempPayment.PcID = int.Parse(oReader["terminal_id"].ToString());
                    }

                    if (oReader["userid"] != null)
                    {
                        tempPayment.UserID = Convert.ToString(oReader["userid"]);
                    }

                    if (oReader["opentime"] != null)
                    {
                        Int64 dateTime = Convert.ToInt64(oReader["opentime"].ToString());
                        tempPayment.PaymentTime = new DateTime(dateTime);// Convert.ToDateTime(dateTime);
                    }
                    paymentdetails.Add(tempPayment);
                }
            }
            tempcResult.Data = paymentdetails;
            return tempcResult;
        }
Exemplo n.º 10
0
        /// <summary>
        /// Changes the print status after printing for indicating whether the guest bill is printed or not.
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public CResult ChangeGuestBillPrintStatus(long orderID)
        {
            CResult oResult = new CResult();
            string sqlCommand = "";

            try
            {
                this.OpenConnection();

                sqlCommand = string.Format(SqlQueries.GetQuery(Query.ChangeGuestBillPrintStatus), orderID);
                this.ExecuteNonQuery(sqlCommand);

                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ChangeGuestBillPrintStatus()", LogLevel.Error, "Database");
                oResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 11
0
        public CResult GetBalanceReport(DateTime fromdate, DateTime todate)
        {
            CResult aResult = new CResult();

            try
            {

                // this.OpenConnection();
                string sqlCommand = String.Format(SqlQueries.GetQuery(Query.GetBalanceReport), fromdate, todate);
                RMS.Common.CCommonConstants oConstants = RMS.ConfigManager.GetConfig<RMS.Common.CCommonConstants>();
                String tempConnStr = oConstants.DBConnection;
                SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand, tempConnStr);
                SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
                DataTable table = new DataTable();
                table.Locale = System.Globalization.CultureInfo.InvariantCulture;
                dataAdapter.Fill(table);
                dataAdapter.Dispose();
                aResult.Data = table;
            }

            catch (Exception ex)
            {

            }
            return aResult;
        }
Exemplo n.º 12
0
        public CResult GetCashreportBydate(DateTime fromtime, DateTime totime)
        {
            CResult aResult = new CResult();
            double amount = 0;

            try
            {

                // this.OpenConnection();
                string sqlCommand = String.Format(SqlQueries.GetQuery(Query.GetCashreportBydate), fromtime,totime);
                RMS.Common.CCommonConstants oConstants = RMS.ConfigManager.GetConfig<RMS.Common.CCommonConstants>();
                String tempConnStr = oConstants.DBConnection;
                SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand, tempConnStr);
                SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
                DataTable table = new DataTable();
                table.Locale = System.Globalization.CultureInfo.InvariantCulture;
                dataAdapter.Fill(table);
                dataAdapter.Dispose();
                aResult.Data = table;
            }

            catch (Exception ex)
            {

            }
            try
            {
                this.OpenConnection();
                string sqlCommand = String.Format(SqlQueries.GetQuery(Query.GetAllCashAmountByDate), fromtime, totime);
                IDataReader oReader = this.ExecuteReader(sqlCommand);

                if (oReader != null)
                {
                    while (oReader.Read())
                    {
                        try
                        {
                            amount += Convert.ToDouble(oReader["Cash_Amount"]);
                        }
                        catch (Exception)
                        {

                        }
                    }
                }

            }

            catch (Exception ex)
            {
                //  result = "Credit Transaction Couldn,t Save Successfully";
            }
            finally
            {
                this.CloseConnection();
            }
            aResult.Amount = amount;
            return aResult;
        }
Exemplo n.º 13
0
 RMS.Common.ObjectModel.CResult IInventroySalesReportDAO.GetSelectionOfItems()
 {
     CResult objResult = new CResult();
     String sqlCommand = String.Format(SqlQueries.GetQuery(Query.GetSelectionofItemsRecords));
     DataSet dsSalessRecords = this.GetDataset(sqlCommand);
     objResult.Data = dsSalessRecords;
     return objResult;
 }
Exemplo n.º 14
0
 RMS.Common.ObjectModel.CResult IInventroySalesReportDAO.GetSalesReport(long p_startTime, long p_endTime)
 {
     CResult objResult = new CResult();
     String sqlCommand = String.Format(SqlQueries.GetQuery(Query.GetInventorySalesRecords), p_startTime, p_endTime);
     DataSet dsSalessRecords = this.GetDataset(sqlCommand);
     objResult.Data = dsSalessRecords;
     return objResult;
 }
Exemplo n.º 15
0
        public CResult GetBookingInfoAll(DateTime inCurrentDate)
        {
            CResult tempResult = new CResult();
            GetTimeSpan(inCurrentDate);

            List<CBooking> oBookingList = new List<CBooking>();

            try
            {
                CCommonConstants oTempConstant = ConfigManager.GetConfig<CCommonConstants>();

                this.OpenConnection();
                string sSql = string.Format(SqlQueries.GetQuery(Query.BookingInfoGetAll), m_oStartTime, m_oEndTime);

                IDataReader oReader = this.ExecuteReader(sSql);
                if (oReader != null)
                {
                    while (oReader.Read())
                    {
                        CBooking oBooking = ReaderToBooking(oReader);
                        oBookingList.Add(oBooking);
                    }
                }
                tempResult.Data = oBookingList;
                tempResult.IsSuccess = true;

                this.CloseConnection();
            }
            catch (Exception ex)
            {
                Console.Write("###" + ex + "###");
                tempResult.IsException = true;

                Logger.Write("Exception : " + ex + " in GetBookingInfoAll()", LogLevel.Error, "Database");
                if (ex.GetType().Equals(typeof(SqlException)))
                {
                    SqlException oSQLEx = ex as SqlException;
                    if (oSQLEx.Number != 7619)
                        throw new Exception("Exception occure at GetBookingInfoAll()", ex);
                }
                else
                {
                    throw new Exception("Exception occure at GetBookingInfoAll()", ex);
                }
            }
            finally
            {
                this.CloseConnection();
            }

            return tempResult;
        }
Exemplo n.º 16
0
        public RMS.Common.ObjectModel.CResult AddCat2(RMS.Common.ObjectModel.CCategory2 inUser)
        {
            CResult oResult = new CResult();

            try
            {
                bool bTempFlag = CheckCat(inUser);

                if (bTempFlag)
                {
                    oResult.Message = "Category2 exists with this name.";
                }
                else
                {
                    CResult oResult2 = GetMaxCatOrder();

                    if (oResult2.IsSuccess && oResult2.Data != null)
                    {
                        int iTempOrder = (int)oResult2.Data;

                        iTempOrder = iTempOrder + 1;

                        inUser.Category2Name = inUser.Category2Name.Replace("''", "'");
                        inUser.Category2Name = inUser.Category2Name.Replace("'", "''");

                        this.OpenConnection();
                        string sSql = String.Format(SqlQueries.GetQuery(Query.AddCategory2), inUser.Category2Name, inUser.Category1ID, iTempOrder, inUser.Category2Type, inUser.Category2Color, inUser.Category2ViewTable, inUser.Category2ViewBar, inUser.Category2ViewTakeAway, RMSGlobal.LogInUserName, DateTime.Now.Ticks);

                        this.ExecuteNonQuery(sSql);

                        oResult.IsSuccess = true;

                    }

                }

            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at ItemInsert()", ex);
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 17
0
        public RMS.Common.ObjectModel.CResult GetCategoryAnchestors(int inLeafCategoryID, int inCatLevel)
        {
            CResult oResult = new CResult();
            try
            {
                this.OpenConnection();
                string sSql = String.Empty;

                if (inCatLevel == 4)
                {
                    sSql = string.Format(SqlQueries.GetQuery(Query.GetCategory4Anchestor), inLeafCategoryID);
                }
                else if (inCatLevel == 3)
                {
                    sSql = string.Format(SqlQueries.GetQuery(Query.GetCategory3Anchestor), inLeafCategoryID);
                }
                else if (inCatLevel == 2)
                {
                    sSql = string.Format(SqlQueries.GetQuery(Query.GetCategory2Anchestor), inLeafCategoryID);
                }
                else if (inCatLevel == 1)
                {
                    sSql = string.Format(SqlQueries.GetQuery(Query.GetCategory1Anchestor), inLeafCategoryID);
                }

                IDataReader oReader = this.ExecuteReader(sSql);

                if (oReader != null)
                {
                    while (oReader.Read())
                    {
                        oResult.Data = ReaderToCategoryAnchestor(oReader);
                    }
                }
                oResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemGetById()", LogLevel.Error, "Database");

                oResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 18
0
        public CResult GetTotalPaymentByTypeNDate(String inType, DateTime inCurrentDate)
        {
            CResult tempResult = new CResult();
            GetTimeSpan(inCurrentDate);

            float tempSummaryByType = 0;
            try
            {
                inType = inType.Replace("''", "'");
                inType = inType.Replace("'", "''");

                this.OpenConnection();
                String sSql1 = String.Format(SqlQueries.GetQuery(Query.PaymentGetTypeTotal), m_oStartTime, m_oEndTime, inType);

                IDataReader oReader = this.ExecuteReader(sSql1);
                if (oReader != null)
                {
                    while (oReader.Read())
                    {
                        if (oReader["type_total"] != null)
                            float.TryParse(oReader["type_total"].ToString(), out tempSummaryByType);
                    }
                }
                tempResult.Data = tempSummaryByType;
                tempResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in GetTotalPaymentByType()", LogLevel.Error, "Database");
                tempResult.IsException = true;
                if (ex.GetType().Equals(typeof(SqlException)))
                {
                    SqlException oSQLEx = ex as SqlException;
                    if (oSQLEx.Number != 7619)
                        throw new Exception("Exception occured at GetTotalPaymentByType(()", ex);
                }
                else
                {
                    throw new Exception("Exception occure at GetTotalPaymentByType(", ex);
                }
            }
            finally
            {
                this.CloseConnection();
            }
            return tempResult;
        }
Exemplo n.º 19
0
        public CResult AddCat2(CCategory2 inUser)
        {
            CResult oResult = new CResult();

            try
            {
                bool bTempFlag = CheckCat(inUser);

                if (bTempFlag)
                {
                    oResult.Message = "Category1 exists with this name.";
                }
                else
                {
                    bTempFlag = CheckCatOrder(inUser);

                    if (bTempFlag)
                    {
                        oResult.Message = "Category order exists. Write another order.";
                    }
                    else
                    {
                        this.OpenConnection();
                        string sSql = "";// String.Format(SqlQueries.GetQuery(Query.AddCategory1), inUser.Category1Name, inUser.Category1Order, inUser.ParentCatID);

                        this.ExecuteNonQuery(sSql);

                        oResult.IsSuccess = true;

                    }

                }

            }
            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at ItemInsert()", ex);
            }
            finally
            {
                this.CloseConnection();
            }
            return oResult;
        }
Exemplo n.º 20
0
        public CResult AvailableTableForUnlock()
        {
            CResult tempResult = new CResult();
            GetTimeSpan(DateTime.Now);
            List<CTransferOrderShow> tempAvailableTableListForUnlock = new List<CTransferOrderShow>();
            try
            {
                CCommonConstants oTempConstant = ConfigManager.GetConfig<CCommonConstants>();

                this.OpenConnection();
                string sSql = string.Format(SqlQueries.GetQuery(Query.ShowAvailableTableForUnlock), m_oStartTime, m_oEndTime);

                IDataReader oReader = this.ExecuteReader(sSql);
                if (oReader != null)
                {
                    while (oReader.Read())
                    {
                        CTransferOrderShow tempTableForUnlock = ReaderToTransferOrderShow(oReader);
                        tempAvailableTableListForUnlock.Add(tempTableForUnlock);
                    }
                }
                tempResult.Data = tempAvailableTableListForUnlock;
                tempResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                tempResult.IsException = true;
                Console.Write("###" + ex + "###");
                Logger.Write("Exception : " + ex + " in AvailableTableForUnlock()", LogLevel.Error, "Database");
                if (ex.GetType().Equals(typeof(SqlException)))
                {
                    SqlException oSQLEx = ex as SqlException;
                    if (oSQLEx.Number != 7619)
                        throw new Exception("Exception occure at AvailableTableForTUnlock()", ex);
                }
                else
                {
                    throw new Exception("Exception occure at AvailableTableForUnlock()", ex);
                }
            }
            finally
            {
                this.CloseConnection();
            }
            return tempResult;
        }
Exemplo n.º 21
0
        private void btnEditCustomer_Click(object sender, EventArgs e)
        {
            //For modifying the customer information
            COrderManager tempOrderManager = new COrderManager();
            CResult objCresult = new CResult();
            objCresult = tempOrderManager.OrderInfoByOrderID(m_orderID);

            CDelivery objDeliveryTime = new CDelivery(); //Collecting the delivery information of the order
            objDeliveryTime.DeliveryOrderID = m_orderID;
            CResult objDeliveryInfo = tempOrderManager.GetDeliveryInfo(objDeliveryTime);
            objDeliveryTime = (CDelivery)objDeliveryInfo.Data;

            COrderInfo tempOrderInfo = (COrderInfo)objCresult.Data;
            CTakeAwayForm objTakeawayFrm = new CTakeAwayForm(m_orderID, objDeliveryTime, tempOrderInfo.Status, true);
            objTakeawayFrm.Show();
            CFormManager.Forms.Push(m_previousForm);
            this.Hide();
        }
Exemplo n.º 22
0
        private void showbutton_Click(object sender, EventArgs e)
        {
            DateTime fromtime =fromdateTimePicker.Value.Date;
            DateTime totime = todateTimePicker.Value.Date;
               CResult aResult=new CResult();
               aResult = aBankTransactionDao.GetDebitreportBydate(fromtime , totime);
            DataTable aTable=new DataTable();
            try
            {
                aTable = (DataTable)aResult.Data;
                debitdataGridView.DataSource = aTable;
                amountlabel.Text = aResult.Amount.ToString("F02");

            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 23
0
        public CResult DeleteUser(CUserInfo inUser)
        {
            try
            {
                m_oResult = RMS.DataAccess.Database.Instance.UserInfo.DeleteUser(inUser);

            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception occuer at DeleteItem() : " + ex.Message);
                m_oResult.IsException = true;
                m_oResult.Action = EERRORNAME.EXCEPTION_OCCURE;
                m_oResult.SetParams(ex.Message);
                m_oResult.Message = ex.Message;
                Logger.Write("Exception : " + ex + " in DeleteItem()", LogLevel.Error, "CItemManager");
            }
            return m_oResult;
        }
Exemplo n.º 24
0
        public CResult GetGeneralSettings()
        {
            CResult tempResult = new CResult();
            string sSql = SqlQueries.GetQuery(Query.GetGeneralSetting);

            try
            {

                this.OpenConnection();
                IDataReader oReader = this.ExecuteReader(sSql);

                GeneralSettings gSettings = new GeneralSettings();

                while (oReader.Read())
                {
                    gSettings.Vat = Convert.ToDouble(oReader[1]);
                    gSettings.IsVatEnabled = Convert.ToBoolean(oReader[2]);
                    gSettings.Currency = oReader[3].ToString(); ;
                }
                tempResult.Data = gSettings;

            }

            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in GetGeneralSettings()", LogLevel.Error, "Database");
                if (ex.GetType().Equals(typeof(SqlException)))
                {
                    SqlException oSQLEx = ex as SqlException;
                    if (oSQLEx.Number != 7619)
                        throw new Exception("Exception occured at GetGeneralSettings()", ex);
                }
                else
                {
                    throw new Exception("Exception occure at GetGeneralSettings()", ex);
                }
            }
            finally
            {
                this.CloseConnection();
            }

            return tempResult;
        }
Exemplo n.º 25
0
        public CResult InsertDeposit(CDeposit inDeposit)
        {
            CResult oResult = new CResult();

            try
            {

                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.DepositInsert), inDeposit.DepositBalance, inDeposit.DepositTime, inDeposit.CustomerID, inDeposit.DepositTotalAmount,inDeposit.PcID,inDeposit.Status,inDeposit.DepositType);
                this.ExecuteNonQuery(sSql);

                sSql = SqlQueries.GetQuery(Query.ScopeIdentity);

                IDataReader oReader = this.ExecuteReader(sSql);
                if (oReader != null)
                {
                    bool bIsRead = oReader.Read();
                    if (bIsRead)
                    {

                        inDeposit.DepositID = Int64.Parse(oReader[0].ToString());
                    }
                    oReader.Close();
                }

                oResult.Data = inDeposit;
                oResult.IsSuccess = true;
            }

            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in InsertDeposit()", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at OrderDetailsInsert()", ex);
                oResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }

            return oResult;
        }
Exemplo n.º 26
0
        //New Added
        public CResult OrderDetailsArchiveGetByOrderID(Int64 inOrderID)
        {
            CResult tempResult = new CResult();
            List<COrderDetails> tempOrderDetailsList = new List<COrderDetails>();
            try
            {
                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.OrderDetailsArchiveGetByOrderId), inOrderID);
                IDataReader oReader = this.ExecuteReader(sSql);
                if (oReader != null)
                {
                    while (oReader.Read())
                    {
                        COrderDetails tempOrderDetails = ReaderToOrderDetails(oReader);
                        tempOrderDetailsList.Add(tempOrderDetails);

                    }
                }
                tempResult.Data = tempOrderDetailsList;
                tempResult.IsSuccess = true;
            }
            catch (Exception ex)
            {
                tempResult.IsException = true;
                Console.Write("###" + ex.ToString() + "###");
                Logger.Write("Exception : " + ex + " in OrderDetailsGetByOrderID()", LogLevel.Error, "Database");
                if (ex.GetType().Equals(typeof(SqlException)))
                {
                    SqlException oSQLEx = ex as SqlException;
                    if (oSQLEx.Number != 7619)
                        throw new Exception("Exception occured at OrderDetailsGetByOrderID()", ex);
                }
                else
                {
                    throw new Exception("Exception occure at OrderDetailsGetByOrderID()", ex);
                }
            }
            finally
            {
                this.CloseConnection();
            }
            return tempResult;
        }
Exemplo n.º 27
0
        public CResult GetAllKitchenText()
        {
            try
              {
              m_oResult=Database.Instance.SaveDefaultTime.GetKitchenText();
              m_oResult.IsSuccess = true;
              m_oResult.Message = "Data Updated Successfully";

              }
              catch (Exception ex)
              {
              System.Console.WriteLine("Exception occuer at UpdateOrderInfo() : " + ex.Message);
              m_oResult.IsException = true;
              m_oResult.Action = EERRORNAME.EXCEPTION_OCCURE;

              m_oResult.Message = ex.Message;
              Logger.Write("Exception : " + ex + " in UpdateOrderInfo()", LogLevel.Error, "COrderManager");
              }
              return m_oResult;
        }
Exemplo n.º 28
0
        public CResult AddItemSelectableAttribute(CItemSelectableAttribute inUser)
        {
            CResult res = new CResult();

            CDalConfig oTempDal = ConfigManager.GetConfig<CDalConfig>();
            String tempConnStr = oTempDal.ConnectionString;
            SqlConnection conn = new SqlConnection(tempConnStr);
            try
            {
                SqlCommand command = new SqlCommand("ISP_item_selectable_attributes", conn);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add("@topping_id", SqlDbType.Int).Value = inUser.ToppingID;
                command.Parameters.Add("@item_selection_id", SqlDbType.Int).Value = inUser.ItemSelectionID;
                command.Parameters.Add("@price", SqlDbType.Decimal).Value = inUser.TablePrice;
                command.Parameters.Add("@item_id", SqlDbType.Int).Value = inUser.ItemID;
                command.Parameters.Add("@is_default", SqlDbType.Bit).Value = inUser.ISDefault;
                command.Parameters.Add("@topping_name", SqlDbType.VarChar).Value = inUser.ToppingName;
                command.Parameters.Add("@IsPizzaTopping", SqlDbType.Bit).Value = false;
                command.Parameters.Add("@tk_price", SqlDbType.Decimal).Value = inUser.TKPrice;
                command.Parameters.Add("@bar_price", SqlDbType.Decimal).Value = inUser.BarPrice;

                if (conn.State != ConnectionState.Open)
                    conn.Open();
                int result = command.ExecuteNonQuery();

                res.IsSuccess = true;
            }
            catch (Exception ex)
            {
                res.IsSuccess = false;

                //   MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                    conn.Close();
            }

            return res;
        }
Exemplo n.º 29
0
 public CResult AvailableTableForVoid()
 {
     try
     {
         //List<CTransferOrderShow> oTableList = Database.Instance.AvailableTableForVoid.AvailableTableForVoid();
         m_oResult = Database.Instance.AvailableTableForVoid.AvailableTableForVoid();
         //m_oResult.Data = oTableList;
         //m_oResult.IsSuccess = true;
         m_oResult.Message = "Data Read Successful";
     }
     catch (Exception ex)
     {
         System.Console.WriteLine("Exception occuer at OrderListForVoid() : " + ex.Message);
         m_oResult.IsException = true;
         m_oResult.Action = EERRORNAME.EXCEPTION_OCCURE;
         m_oResult.SetParams(ex.Message);
         m_oResult.Message = ex.Message;
         Logger.Write("Exception : " + ex + " in OrderListForVoid()", LogLevel.Error, "COrderManager");
     }
     return m_oResult;
 }
Exemplo n.º 30
0
        public CResult GetInitialDBStr()
        {
            CResult oResult = new CResult();

            try
            {
                CDalConfig oTempDal = ConfigManager.GetConfig<CDalConfig>();

                String sTempDB = oTempDal.ConnectionString;

                oResult.Data = sTempDB;

                oResult.IsSuccess = true;

            }
            catch (Exception ex)
            {
            }

            return oResult;
        }