/// <summary> /// 创建一个供应商缴纳地 /// </summary> /// <param name="validationErrors">返回的错误信息</param> /// <param name="db">数据库上下文</param> /// <param name="entity">一个供应商缴纳地</param> /// <returns></returns> public bool Create(ref ValidationErrors validationErrors, SupplierNatureCity entity) { try { repository.Create(entity); return(true); } catch (Exception ex) { validationErrors.Add(ex.Message); ExceptionsHander.WriteExceptions(ex); } return(false); }
//获得缴纳地 private List <SupplierNatureCity> GetCityList(string city) { List <SupplierNatureCity> list = new List <SupplierNatureCity>(); if (!string.IsNullOrEmpty(city)) { string[] arrCity = city.Split(','); for (int i = 0; i < arrCity.Count(); i++) { SupplierNatureCity model = new SupplierNatureCity(); model.NatureCityId = arrCity[i]; list.Add(model); } } return(list); }