Пример #1
0
        public static hrm_atd_ScanTime GetById(string[] id, string[] select, string[] manual_in, string[] manual_out, string[] requestor_note, string Event)
        {
            string key  = String.Format(SETTINGS_ID_KEY, id);
            object obj2 = HttpCache.Get(key);

            if (obj2 != null)
            {
                return((hrm_atd_ScanTime)obj2);
            }

            hrm_atd_ScanTime b = new hrm_atd_ScanTime();

            using (var client = WebApiHelper.myclient(HouseEndpoint, SystemConst.APIJosonReturnValue))
            {
                HttpResponseMessage response = client.GetAsync(string.Format(Resource + "?ID={0}", id)).GetAwaiter().GetResult();

                if (response.IsSuccessStatusCode)
                {
                    b = response.Content.ReadAsAsync <hrm_atd_ScanTime>().GetAwaiter().GetResult();
                }
            }
            HttpCache.Max(key, b);
            return(b);
        }
        public ActionResult Get(Guid ID, string action)
        {
            hrm_atd_ScanTime objItem = hrm_atd_ScanTimeManager.GetById(ID);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
        /// <summary>
        /// use for scrolling page
        /// </summary>
        /// <returns></returns>

        public ActionResult Get(Guid ID)
        {
            hrm_atd_ScanTime objItem = hrm_atd_ScanTimeManager.GetById(ID);

            return(View(objItem));
        }
Пример #4
0
 // PUT api/<controller>/5
 /// <summary>
 /// Puts the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 /// <exception cref="HttpResponseException"></exception>
 public hrm_atd_ScanTime Put(string id, [FromBody] hrm_atd_ScanTime value)
 {
     return(hrm_atd_ScanTimeManager.UpdateItem(value));
 }