public bool Add(MyDictionary dictionary) { CheckFields(dictionary); CheckWords(dictionary); int affectedRows = _dictDal.Add(dictionary); return(affectedRows > 0); }
public ActionResult CreateDictionary(DictionaryViewModel model) { DictionaryDAL ddal = new DictionaryDAL(); ddal.Add(model.CastDB(model)); ddal.AcceptAllChange(); return(Content("Success")); }
/// <summary> /// 新增 /// </summary> /// <param name="model"></param> /// <returns></returns> public string Add(HrDictionary model) { if (model == null) { return(string.Empty); } using (DictionaryDAL dal = new DictionaryDAL()) { HR_DICTIONARY entity = ModelToEntity(model); entity.DICTIONARYID = string.IsNullOrEmpty(model.DictionaryId) ? Guid.NewGuid().ToString() : model.DictionaryId; return(dal.Add(entity)); } }