public string Insert(ModelViewLog model) { if (model.TokenApp != GlobalConfiguration.TokenWEB) { if (model.TokenApp != GlobalConfiguration.TokenMobile) { throw new Exception("TokenInvalid"); } } var User = new BusinessUsers().GetUserByToken(model.TokenUser); List <string> token = new List <string>(); foreach (var item in model.Detail) { var Ods = new BusinessOrder().GetByOrderID(item.OrderID); EntityLogMobile data = new EntityLogMobile() { PK_LogMobileID = 0, FK_OrderID = Ods == null ? 0 : Ods.PK_OrderID, FK_UserID = User.UserID, UserName = User.UserName, Name = User.Name, OrderID = item.OrderID, Module = item.Module, Message = item.Message, InnerException = item.InnerException, StackTrace = item.StackTrace, SignType = item.SignType, Battery = item.Battery, SignPercentage = item.SignPercentage, ConnectionType = item.ConnectionType, version = item.version, MobileModel = item.MobileModel, MobileStorage = item.MobileStorage, Type = item.Type, Date = DateTime.Parse(item.Date), Status = true, CreateDate = DateTime.UtcNow, ModifyDate = DateTime.UtcNow }; data = new RepositoryLogMobile().Insert(data); token.Add(item.TokenLog); } string TokenLog = string.Join(",", token); return(TokenLog); }
public JsonResult GetShopPlace(string value) { try { ModelViewUserG objCred = new JavaScriptSerializer().Deserialize <ModelViewUserG>(value); if (!objCred.Date.HasValue) { FacadeLog.MobileWriteEntry("Order/GetShopPlace|FirstSync|" + value); var detail = new List <ModelViewDetail>(); detail.Add(new ModelViewDetail() { Battery = "--", ConnectionType = "--", Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), InnerException = "--", Message = "Primera sincronización", Module = "app.activities.SynchronizationActivity", OrderID = "--", SignPercentage = "--", SignType = "--", StackTrace = "--", TokenLog = "", Type = "Information", version = "--" }); ModelViewLog dataODS = new ModelViewLog() { TokenApp = objCred.TokenApp, TokenUser = objCred.TokenUser, Detail = detail }; var token = FacadeLogMobile.Insert(dataODS); } var lt = FacadeShopPlace.GetListShopPlace(objCred); return(Json(lt, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw ex; } }
public static string Insert(ModelViewLog model) { return(new BusinessLogMobile().Insert(model)); }