public string SubmitDoubt(DoubtInfo_Add doubt) { var id = Guid.NewGuid().ToString("N"); var entity = new Doubt { Id = id, Title = doubt.Title, Description = doubt.Description, Category = doubt.Category, ShowIndex = 0, UpCount = 0, DownCount = 0, CreateTime = DateTime.Now, CreateUserKey = doubt.CreateUserKey, CreateUserDisplayName = doubt.CreateUserDisplayName, UpdateTime = DateTime.Now, UpdateUserKey = doubt.CreateUserKey, UpdateUserDisplayName = doubt.CreateUserDisplayName, }; using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new DoubtManager()) { manager.AddDoubt(entity); } biz.CommitTran(); } return(id); }
public IList QueryDoubtList_Web(string key, string category, string userId, int pageIndex, int pageSize, out int totalCount) { using (var manager = new DoubtManager()) { var list = manager.QueryDoubtList_Web(key, category, userId, pageIndex, pageSize, out totalCount); return(list); } }
public DoubtInfo_Query QueryDoubtInfoById(string doubtId) { using (var manager = new DoubtManager()) { var entity = manager.GetDoubtById(doubtId); var info = new DoubtInfo_Query(); ObjectConvert.ConverEntityToInfo <Doubt, DoubtInfo_Query>(entity, ref info); return(info); } }
public void UpdateDoubtIndex(Dictionary <string, int> indexCollection) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new DoubtManager()) { manager.UpdateDoubtIndex(indexCollection); } biz.CommitTran(); } }
public void DeleteDoubt(string doubtId) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new DoubtManager()) { var entity = manager.GetDoubtById(doubtId); if (entity == null) { throw new ArgumentException("指定编号的问题不存在"); } manager.DeleteUpDownRecord(doubtId); manager.DeleteDoubt(entity); } biz.CommitTran(); } }
public void UpDownDoubt(string doubtId, string userId, string operation) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new DoubtManager()) { var entity = manager.GetDoubtById(doubtId); if (entity == null) { throw new ArgumentException("指定编号的问题不存在"); } var record = manager.GetUpDownRecord(userId, doubtId); if (record != null) { throw new ArgumentException("不能重复操作"); } if (operation.ToUpper() == "UP") { entity.UpCount++; } else { entity.DownCount++; } manager.UpdateDoubt(entity); record = new UpDownRecord { UserId = userId, DoubtId = doubtId, UpDown = operation, CreateTime = DateTime.Now, }; manager.AddUpDownRecord(record); } biz.CommitTran(); } }
public void UpdateDoubt(string doubtId, DoubtInfo_Add doubt) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var manager = new DoubtManager()) { var entity = manager.GetDoubtById(doubtId); if (entity == null) { throw new ArgumentException("指定编号的问题不存在"); } entity.Title = doubt.Title; entity.Description = doubt.Description; entity.Category = doubt.Category; entity.UpdateTime = DateTime.Now; entity.UpdateUserKey = doubt.CreateUserKey; entity.UpdateUserDisplayName = doubt.CreateUserDisplayName; manager.UpdateDoubt(entity); } biz.CommitTran(); } }