Example #1
0
        public bool LogMobileTrail(MobileOperatorTrail trail)
        {
            bool insertResult = false;

            try
            {
                string insertMobileUser = "******" +
                                          " VALUES('" + trail.ReferenceNo.Format_Sql_String() + "','" +
                                          trail.Ledger.Format_Sql_String() + "','" +
                                          trail.CustomerNo.Format_Sql_String() + "','" +
                                          trail.AccountNo.Format_Sql_String() + "','" +
                                          ValueConverters.FormatSqlDate(trail.TransactionDate) + "','" +
                                          trail.Description.Format_Sql_String() + "','" +
                                          ValueConverters.ConvertNullToDecimal(trail.Amount) + "','" +
                                          trail.DeviceInfo.Format_Sql_String() + "','" +
                                          trail.LoginCode.Format_Sql_String() + "','" +
                                          Guid.NewGuid().ToString() + "'); ";

                int result = db.Database.ExecuteSqlCommand(insertMobileUser);

                if (result >= 1)
                {
                    insertResult = true;
                }
            }
            catch (Exception ex)
            {
                Utility.WriteErrorLog(ex.Message, ref ex);
            }

            return(insertResult);
        }