/// <summary> /// 保存设置数据 /// </summary> /// <returns></returns> /// [HttpPost] public ActionResult SaveData(string deleteStr, string entity, string setTime, string regulation) { var del = deleteStr.Replace("[", "").Replace("]", "").Replace("\"", "").Split(','); var data = entity.Replace("[", "").Replace("]", "").Replace("\"", "").Split(','); List <SevenSPictureSetEntity> list = new List <SevenSPictureSetEntity>(); if (data.Length >= 2) { for (int i = 0; i < data.Length - 1; i = i + 2) { var one = new SevenSPictureSetEntity(); one.Id = Guid.NewGuid().ToString(); one.space = data[i]; one.remark = data[i + 1]; one.createtime = DateTime.Now.ToString(); list.Add(one); } } try { ebll.SaveFrom(list, del, setTime, regulation); return(Success("保存成功。")); } catch (Exception) { return(Error("保存失败")); } }
/// <summary> /// 添加地点设置 /// </summary> /// <param name="entity"></param> public void InsertPhoneSet(SevenSPictureSetEntity entity) { var db = new RepositoryFactory().BaseRepository().BeginTrans(); try { entity.Create(); entity.Files = null; db.Insert(entity); db.Commit(); } catch (Exception) { db.Rollback(); throw; } }
/// <summary> /// 添加地点设置 /// </summary> /// <param name="entity"></param> public void InsertPhoneSet(SevenSPictureSetEntity entity) { service.InsertPhoneSet(entity); }