当前位置: 首页>>代码示例>>C#>>正文


C# ObjectModel.CResult类代码示例

本文整理汇总了C#中RMS.Common.ObjectModel.CResult的典型用法代码示例。如果您正苦于以下问题:C# CResult类的具体用法?C# CResult怎么用?C# CResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CResult类属于RMS.Common.ObjectModel命名空间,在下文中一共展示了CResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateButtonColor

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:25,代码来源:CButtonColorDAO.cs

示例2: Cat1Delete

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:25,代码来源:CCategory1DAO.cs

示例3: InsertDelivery

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:28,代码来源:CDeliveryDAO.cs

示例4: UpdatePrintStyle

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:27,代码来源:CPrintStyleDAO.cs

示例5: AddButtonColor

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:27,代码来源:CButtonColorDAO.cs

示例6: GetButtonColor

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:32,代码来源:CButtonColorDAO.cs

示例7: AddUser

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:25,代码来源:CUserInfoDAO.cs

示例8: Cat2Delete

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:25,代码来源:CCategory2DAO.cs

示例9: GetDrawerLogDetails

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:33,代码来源:CPaymentDAO.cs

示例10: ChangeGuestBillPrintStatus

        /// <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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:30,代码来源:COrderInfoDAO.cs

示例11: GetBalanceReport

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:26,代码来源:BankTransactionDAO.cs

示例12: GetCashreportBydate

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:59,代码来源:BankTransactionDAO.cs

示例13: CResult

 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;
 }
开发者ID:Jusharra,项目名称:RMS,代码行数:8,代码来源:InventroySalesReportDAO.cs

示例14: GetBookingInfoAll

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:52,代码来源:CBookingDAO.cs

示例15: AddCat2

        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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:49,代码来源:CCategory2DAO.cs


注:本文中的RMS.Common.ObjectModel.CResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。