Esempio n. 1
0
        public string UpdateSoftZoneJule(HttpRequestMessage request)
        {
            try
            {
                var    content = request.Content;
                string j       = content.ReadAsStringAsync().Result;
                AttractionInfoRequest attractionInfoRequest = new AttractionInfoRequest();
                attractionInfoRequest = JsonConvert.DeserializeObject <AttractionInfoRequest>(j);
                if (attractionInfoRequest.admin.check())
                {
                    SqlConn conn = new SqlConn();
                    AttractionsInfoResponce attractionsInfo = new AttractionsInfoResponce();
                    List <Pair>             pairs           = new List <Pair>();
                    pairs.Add(new Pair("attractions", JsonConvert.SerializeObject(attractionInfoRequest.attractions)));
                    pairs.Add(new Pair("active", attractionInfoRequest.active));
                    conn.update("sales_info", "sales_name='4sale'", pairs);

                    attractionsInfo.attractions = conn.select12SaleSalesInfo("sales_info", "sales_name='4sale'").attractions;
                    attractionsInfo.active      = conn.select12SaleSalesInfo("sales_info", "sales_name='4sale'").active;
                    return(JsonConvert.SerializeObject(attractionsInfo));
                }
                return(null);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.ToString());
                logger.Error(exc.ToString());
                return(null);
            }
        }
Esempio n. 2
0
 public string GetCheckedSoftZoneJule(HttpRequestMessage request)
 {
     try
     {
         var    content = request.Content;
         string j       = content.ReadAsStringAsync().Result;
         Admin  admin   = new Admin();
         admin = JsonConvert.DeserializeObject <Admin>(j);
         if (admin.check())
         {
             SqlConn conn = new SqlConn();
             AttractionsInfoResponce attractionsInfo = new AttractionsInfoResponce();
             attractionsInfo.attractions = conn.select12SaleSalesInfo("sales_info", "sales_name='4sale'").attractions;
             attractionsInfo.active      = conn.select12SaleSalesInfo("sales_info", "sales_name='4sale'").active;
             return(JsonConvert.SerializeObject(attractionsInfo));
         }
         return(null);
     }
     catch (Exception exc)
     {
         Console.WriteLine(exc.ToString());
         logger.Error(exc.ToString());
         return(null);
     }
 }