Example #1
0
        public static string DeleteConfigItem(string itemID)
        {
            AjaxResponse response = new AjaxResponse();

            try
            {
                //Initial data context variable, this class is declared in .dbml file in xRPDAL namespace
                Sys_ThongSoHeThongRepository repository = new Sys_ThongSoHeThongRepository();
                Sys_ThongSoHeThong           entity     = repository.GetById(int.Parse(itemID));
                repository.DeleteOnSubmit(entity);
                repository.SubmitChanges();
                response.IsSuccess = true;
                response.Message   = "OK";
            }
            catch (Exception ex)
            {
                response.IsSuccess = false;
                response.Message   = (ex.Message + ex.StackTrace).EncodeJsString();
            }
            return(JsonConvert.SerializeObject(response));
        }