Exemplo n.º 1
0
 public ActionResult GetCarPolicyInfo(string id)
 {
     try
     {
         var result = _carFinancePolicyRepository.Get(id);
         return(Success("获取政策成功", result));
     }
     catch (Exception ex)
     {
         return(Fail("获取政策失败:" + ex.Message));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 删除金融政策
        /// </summary>
        /// <param name="ids"></param>
        public void DeletePolicy(string ids)
        {
            try
            {
                if (string.IsNullOrEmpty(ids))
                {
                    throw new Exception("id不允许为空");
                }

                string[] arr = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < arr.Length; i++)
                {
                    var entity = _carFinancePolicyRepository.Get(arr[i]);
                    _carFinancePolicyRepository.Delete(entity);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }