public CustomShareText Edit(CustomShareText shareText)
        {
            try
            {
                connection.Open();

                var cmd = connection.CreateCommand() as SqlCommand;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "CustomShareText_Edit";
                cmd.Parameters.Add(new SqlParameter("@RegionId", shareText.RegionId));
                cmd.Parameters.Add(new SqlParameter("@Language", shareText.Language));
                cmd.Parameters.Add(new SqlParameter("@ShareOk", shareText.ShareOk));
                cmd.Parameters.Add(new SqlParameter("@ShareAlert", shareText.ShareAlert));
                cmd.Parameters.Add(new SqlParameter("@ShareAlertFinca", shareText.ShareAlertFinca));
                cmd.Parameters.Add(new SqlParameter("@HashTagRegister", shareText.HashTagRegister));
                cmd.Parameters.Add(new SqlParameter("@HashTagReportConfirmed", shareText.HashTagReportConfirmed));
                cmd.Parameters.Add(new SqlParameter("@HashTagRanking", shareText.HashTagRanking));
                cmd.Parameters.Add(new SqlParameter("@HashTagTop1", shareText.HashTagTop1));
                cmd.Parameters.Add(new SqlParameter("@HashTagCheck", shareText.HashTagCheck));
                cmd.Parameters.Add(new SqlParameter("@HashTagVerification", shareText.HashTagVerification));
                cmd.Parameters.Add(new SqlParameter("@HashTagDenounce", shareText.HashTagDenounce));
                cmd.Parameters.Add(new SqlParameter("@HashTagContestWon", shareText.HashTagContestWon));
                cmd.Parameters.Add(new SqlParameter("@Id", shareText.Id));
                cmd.ExecuteNonQuery();

                connection.Close();
                return null;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public HttpResponseMessage<CustomShareText> Edit(CustomShareText shareText, HttpRequestMessage<CustomShareText> request)
        {
            if (shareText != null)
            {
                var shareTextDb = customShareTextRepository.Edit(shareText);

                return new HttpResponseMessage<CustomShareText>(shareTextDb) { StatusCode = HttpStatusCode.Created };
            }
            return new HttpResponseMessage<CustomShareText>(null) { StatusCode = HttpStatusCode.NotFound, };
        }
        public void GetByRegionIdAndLanguage(int regionId, string language)
        {
            client.Authenticator = new HttpBasicAuthenticator(Current.Instance.Username, Current.Instance.Password);
            var request = new RestRequest("customsharetext/getbyregionidandlanguage", Method.POST) { RequestFormat = DataFormat.Json };
            request.JsonSerializer = new JsonSerializer();
            var shareText = new CustomShareText();
            shareText.RegionId= regionId;
            shareText.Language = language;
            request.AddBody(shareText);

            client.ExecuteAsync<CustomShareText>(request, response =>
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                    TextsReceived(response.Data, null)
                    ));
        }
 public HttpResponseMessage<CustomShareText> GetByRegionIdAndLanguage(CustomShareText shareText, HttpRequestMessage<CustomShareText> request)
 {
     try
     {
         return new HttpResponseMessage<CustomShareText>(customShareTextRepository.GetByRegionIdAndLanguage(shareText.RegionId, shareText.Language)) { StatusCode = HttpStatusCode.OK };
     }
     catch
     {
         return new HttpResponseMessage<CustomShareText>(null) { StatusCode = HttpStatusCode.BadRequest };
     }
 }
        public HttpResponseMessage<CustomShareText> Post(CustomShareText shareText, HttpRequestMessage<CustomShareText> request)
        {
            if (shareText != null)
            {
                var shareTextDB = customShareTextRepository.Insert(shareText);

                var response = new HttpResponseMessage<CustomShareText>(shareTextDB) { StatusCode = HttpStatusCode.Created };
                return response;
            }
            return new HttpResponseMessage<CustomShareText>(null) { StatusCode = HttpStatusCode.NotFound, };
        }