private object PostTransactions(dynamic parameters)
        {
            SiteTransaction newTransaction = this.Bind <SiteTransaction>();

            logManager.Write("[POST] PostTransactions");
            int result = _siteTransactionRepository.PostSiteTransaction(newTransaction);

            return(Response.AsJson(result));
        }
        private ISiteTransaction ParseLine(string line)
        {
            ISiteTransaction transaction = new SiteTransaction();

            string[] data = line.Split(' ');

            for (int i = 0; i < data.Length; i++)
            {
                string currentProperty = logIndexDictionary[i]; // Get property for this Index;
                Type   IISLDT          = typeof(SiteTransaction);

                PropertyInfo[] properties = IISLDT.GetProperties();
                foreach (PropertyInfo property in properties)
                {
                    if (property.Name == currentProperty)
                    {
                        object value = Convert.ChangeType(data[i], property.PropertyType);
                        property.SetValue(transaction, value);
                        break;
                    }
                }
            }
            return(transaction);
        }
Esempio n. 3
0
 public int PostSiteTransaction(SiteTransaction siteTransaction)
 {
     return(DataVault
            .Post(DapperMethod.CoreServices.PostSiteLog, siteTransaction));
 }