public OperationResult UpdateMobileLang(NotificationModelcs model) { OperationResult or; try { or = new UserBL().UpdateMobileLang(model); } catch (Exception ex) { throw ex; } return(or); }
public OperationResult UpdateMobileLang(NotificationModelcs model) { var be = new BusinessException(); OperationResult or = new OperationResult(); using (IDbConnection db = new SqlConnection(TransportationConstants.Cn)) { if (db.State == ConnectionState.Closed) { db.Open(); } try { var result = db.Query <int>("Mob_UpdateMobileLang", new { Lang = model.Lang, IEMI = model.IEMI, UserID = model.UserID, AccessToken = model.AccessToken, IOS = model.IOS }, commandType: CommandType.StoredProcedure).SingleOrDefault(); db.Close(); if (result > 0) { or.Result = result; } else { or.Exceptions.Add("there is an error please try again "); } return(or); } catch (Exception e) { throw e; } } }