public UserApply EntityToModel(CTMS_USERAPPLY entity) { if (entity != null) { var model = new UserApply() { ID = entity.ID, APPLYID = entity.APPLYID, USERID = entity.USERID, GUIDELINEID = entity.GUIDELINEID, CURRENTNODE = entity.CURRENTNODE, STATUS = entity.STATUS, DOCTORSUGGEST = entity.DOCTORSUGGEST, ENTRYDATE = entity.ENTRYDATE, EXITDATE = entity.EXITDATE, CREATEUSERID = entity.CREATEUSERID, CREATEDATETIME = entity.CREATEDATETIME, EDITUSERID = entity.EDITUSERID, EDITDATETIME = entity.EDITDATETIME, ISDELETED = entity.ISDELETED, OWNERID = entity.OWNERID }; return(model); } return(null); }
public CTMS_USERAPPLY ModelToEntity(UserApply model) { if (model != null) { var entity = new CTMS_USERAPPLY() { ID = model.ID, APPLYID = model.APPLYID, USERID = model.USERID, GUIDELINEID = model.GUIDELINEID, CURRENTNODE = model.CURRENTNODE, STATUS = model.STATUS, DOCTORSUGGEST = model.DOCTORSUGGEST, ENTRYDATE = model.ENTRYDATE, EXITDATE = model.EXITDATE, CREATEUSERID = model.CREATEUSERID, CREATEDATETIME = model.CREATEDATETIME, EDITUSERID = model.EDITUSERID, EDITDATETIME = model.EDITDATETIME, ISDELETED = model.ISDELETED, OWNERID = model.OWNERID }; return(entity); } return(null); }
public bool AddCourseApply(CourseView model, UserApply user) { ReturnState result; courseClient.AddCourseApply(model, user, out result, out specify); return(result == ReturnState.ReturnOK); }
public override bool TakeAction() { var cacheSet = new ShareCacheStruct <UserApply>(); UserApply apply = cacheSet.FindKey(guildID, ContextUser.UserID); if (apply != null) { cacheSet.Delete(apply); } return(true); }
public CTMS_USERAPPLY ModelTpEntity(UserApply model) { //using (var context = new CRDatabase()) //{ // var eneity = context.CTMS_USERAPPLY.FirstOrDefault(p => p.ID==model.ID); // if (eneity!=null) // { // CTMS_USERAPPLY addEntity = new CTMS_USERAPPLY(); // addEntity.ID = Guid.NewGuid().ToString(); // } //} return(null); }
public override bool TakeAction() { List <UserQueue> queueArray = new GameDataCacheSet <UserQueue>().FindAll(ContextUser.UserID, m => m.QueueType == QueueType.TuiChuGongHui); if (queueArray.Count > 0 && queueArray[0].DoRefresh() > 0 && queueArray[0].IsSuspend == false) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; this.ErrorInfo = LanguageManager.GetLang().St6006_GuildMemberNotDate; return(false); } List <UserApply> applyArray = new ShareCacheStruct <UserApply>().FindAll(m => m.UserID == ContextUser.UserID); if (applyArray.Count > 3) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; this.ErrorInfo = LanguageManager.GetLang().St6006_ApplyMaxGuild; return(false); } UserApply apply = new ShareCacheStruct <UserApply>().FindKey(guildID, ContextUser.UserID); if (apply != null) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; this.ErrorInfo = LanguageManager.GetLang().St6006_ApplyMember; return(false); } List <GuildMember> guildMemberArray = new ShareCacheStruct <GuildMember>().FindAll(m => m.UserID == ContextUser.UserID); if (guildMemberArray.Count > 0) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; this.ErrorInfo = LanguageManager.GetLang().St6006_AlreadyMember; return(false); } UserApply userApply = new UserApply() { GuildID = guildID, UserID = ContextUser.UserID, ApplyDate = DateTime.Now }; new ShareCacheStruct <UserApply>().Add(userApply, GameEnvironment.CacheGlobalPeriod); return(true); }
public static bool AddCourseApply(CourseView model, UserApply user) { var result = false; using (var conn = new SqlConnection(connectionString)) { conn.Open(); var cmdText = string.Format("insert into tmp_CourseSets values (N'{0}', '{1}', '{2}', {3}, {4}, N'{5}', N'{6}', N'{7}')", model.Code, user.Email, DateTime.Now, user.Status, model.University, model.Name, model.Desp, model.PicUrl); using (var cmd = new SqlCommand(cmdText, conn)) { result = cmd.ExecuteNonQuery() > 0; conn.Close(); } } return(result); }
public string Add(UserApply model) { if (model == null) { return(string.Empty); } if (string.IsNullOrEmpty(model.ID)) { model.ID = Guid.NewGuid().ToString(); } using (var context = new CRDatabase()) { context.Set <CTMS_USERAPPLY>().Add(ModelToEntity(model)); context.SaveChanges(); return(model.ID); } }
/// <summary> /// 发送用户待办通知 /// </summary> private void SendEvent(string uid, string loginname) { string _appleID = Guid.NewGuid().ToString(); DoctorControlBll dcbll = new DoctorControlBll(); UserApply userApply = new UserApply(); userApply.ID = Guid.NewGuid().ToString(); userApply.APPLYID = _appleID; userApply.USERID = uid; userApply.GUIDELINEID = "1"; userApply.STATUS = "1"; userApply.CREATEDATETIME = DateTime.Now; userApply.ISDELETED = false; dcbll.Add(userApply); UserEvent userEvent = new UserEvent(); userEvent.FromUser = ""; userEvent.UserApplyId = userApply.ID; userEvent.ActionType = ((int)ActionType.待办事项).ToString(); userEvent.ActionInfo = "您已注册成功,请上传您的病历资料"; userEvent.ReceiptTime = DateTime.Now; userEvent.ActionStatus = ((int)ActionStatus.Progress).ToString(); userEvent.ToUser = uid; userEvent.CreateTime = DateTime.Now; userEvent.LinkUrl = "ViewUpload"; UserEventBLL userEventBLL = new UserEventBLL(); userEventBLL.Add(userEvent); CancerUserInfoRepository cancerUserRepository = new CancerUserInfoRepository(); HR_CNR_USER cnr_User = new HR_CNR_USER(); cnr_User.CREATTIME = DateTime.Now; cnr_User.USERID = uid; cnr_User.NAME = loginname; cancerUserRepository.Insert(cnr_User); }
public IHttpActionResult Get(string eventId) { try { UserEvent e = _event.Get(p => p.EVENTID == eventId); UserEvent userEvent = _event.Get(p => p.EVENTID == e.Remarks); UserInfo user = _user.GetUserInfoByID(userEvent.ToUser); UserApply apply = _apply.GetModelUserApply(e.UserApplyId); UserEventModel model = new UserEventModel(); model.User = user; model.Event = userEvent; model.Apply = apply; Response <UserEventModel> rsp = new Response <UserEventModel>(); rsp.Data = model; return(Ok(rsp)); } catch (Exception ex) { LogService.WriteErrorLog("ServiceTaskController[Get]", ex.ToString()); return(BadRequest(ex.Message)); } }
public ReturnState AddCourseApply(CourseView model, UserApply user) { return(CourseOperator.AddCourseApply(model, user) ? ReturnState.ReturnOK : ReturnState.ReturnError); }
public bool SaveUserApply(UserApply model) { using (var context = new CRDatabase()) { //根据model的NextCurrentNode字段来判断是否有选择 //if (model.NextCurrentNode == "") //当为空的时候,默认就更新几个字段 //{ // var entity = context.CTMS_USERAPPLY.FirstOrDefault(p => p.APPLYID == oldApplyId); // entity.DOCTORSUGGEST = model.DOCTORSUGGEST; // return context.SaveChanges() > 0; //} //else //{ UserInfo currentUser = new UserInfoService().GetCurrentUser(); UserEventBLL ueBll = new UserEventBLL(); UserEvent ueModel = new UserEvent(); UserEvent oldEvent = ueBll.Get(p => p.EVENTID == model.EventId); //更新原先的待办信息 ueBll.CloseEvent(model.EventId); var entity = context.CTMS_USERAPPLY.FirstOrDefault(p => p.APPLYID == model.APPLYID); entity.STATUS = ((int)ActionStatus.Complete).ToString(); var addModel = new CTMS_USERAPPLY(); addModel.ID = Guid.NewGuid().ToString(); addModel.APPLYID = model.APPLYID; addModel.USERID = entity.USERID; addModel.GUIDELINEID = entity.GUIDELINEID; addModel.CURRENTNODE = model.NextCurrentNode; addModel.STATUS = ((int)ActionStatus.Progress).ToString(); addModel.DOCTORSUGGEST = model.DOCTORSUGGEST; addModel.ENTRYDATE = model.ENTRYDATE; addModel.EXITDATE = model.EXITDATE; addModel.ISDELETED = false; context.CTMS_USERAPPLY.Add(addModel); //发送待办任务 CancerUserInfoRepository _repository = new CancerUserInfoRepository(); HR_CNR_USER user = _repository.FindOne(p => p.USERID == entity.USERID); ueModel.EventID = Guid.NewGuid().ToString(); string userEventId = ueModel.EventID; ueModel.UserApplyId = addModel.ID; ueModel.ActionType = "1"; ueModel.ActionInfo = "您收到了Doc医生的建议,请查看";// + model.NextCurrentNodeName; ueModel.ReceiptTime = System.DateTime.Now; ueModel.ActionStatus = ((int)ActionStatus.Progress).ToString(); ueModel.FromUser = currentUser.UserId; ueModel.ToUser = entity.USERID; ueModel.CreateTime = System.DateTime.Now; ueModel.LinkUrl = "DoTreatmentView"; //用户待办界面 ueModel.ModelId = oldEvent.ModelId; ueBll.AddUserEvent(ueModel); #region 推荐产品与待办关联 string _guidID = model.NextCurrentNode == "" ? model.CURRENTNODE : model.NextCurrentNode; GuidelineProductBLL gpBLL = new GuidelineProductBLL(); IEnumerable <GuidelineProduct> products = gpBLL.GetList(p => p.GUIDELINEID.Equals(_guidID)); EventProductBLL epdBLL = new EventProductBLL(); foreach (GuidelineProduct item in products) { EventProduct eventProduct = new EventProduct(); eventProduct.EventId = ueModel.EventID; eventProduct.ProductID = item.ProductId; eventProduct.ProductName = item.ProductName; eventProduct.ProductPrice = item.ProductPrice; eventProduct.ProductDes = item.Productdes; eventProduct.IsAlreadyBuy = "0"; epdBLL.Add(eventProduct); } #endregion #region 发送客服待办 ueModel = new UserEvent(); ueModel.EventID = Guid.NewGuid().ToString(); ueModel.UserApplyId = addModel.ID; ueModel.ActionType = "1"; ueModel.ActionInfo = string.Format("{0}收到了{1}对于病例的处理建议,请跟踪", user.USERNAME, currentUser.LoginName); ueModel.ReceiptTime = System.DateTime.Now; ueModel.ActionStatus = ((int)ActionStatus.Progress).ToString(); ueModel.FromUser = currentUser.UserId; var toUserId = context.CTMS_SYS_USERINFO.FirstOrDefault(p => p.USERTYPE == (decimal)UserType.客服); ueModel.ToUser = toUserId.USERID; ueModel.CreateTime = System.DateTime.Now; ueModel.LinkUrl = "ServiceTask"; //客服待办 ueModel.Remarks = userEventId; ueModel.ModelId = oldEvent.ModelId; ueBll.AddUserEvent(ueModel); #endregion return(context.SaveChanges() > 0); //} } }
private ExtUserEvent GetExtData(UserEvent userEvent) { ExtUserEvent extUserEvent = new ExtUserEvent(); extUserEvent.EventID = userEvent.EventID; extUserEvent.ActionStatus = userEvent.ActionStatus; extUserEvent.Remarks = userEvent.Remarks; List <UserEvent> tracks = bll.GetList(p => p.USERAPPLYID.Equals(userEvent.UserApplyId)).OrderBy(p => p.CreateTime).ToList(); UserInfoService userService = new UserInfoService(); UserRoleBLL userRoleBLL = new UserRoleBLL(); RoleBLL roleBLL = new RoleBLL(); for (int i = 0; i < tracks.Count; i++) { string _userID = tracks[i].ToUser; UserInfo userInfo = userService.GetUserInfoByID(_userID); if (userInfo == null) { tracks[i].ToUser = ""; } else { tracks[i].ToUser = userInfo.LoginName; } UserRole userrole = userRoleBLL.GetOne(p => p.USERID.Equals(_userID)); if (userrole == null) { tracks[i].Remarks = ""; } else { Role role = roleBLL.Get(userrole.RoleID); tracks[i].Remarks = role == null ? "" : role.RoleName; } } //todo:20160119演示用,临时去了客服的代办信息 extUserEvent.Tracks = tracks.Where(p => !p.Remarks.Contains("客服")).ToList(); //extUserEvent.Tracks = tracks; DoctorControlBll dcBLL = new DoctorControlBll(); UserApply userApply = dcBLL.GetModelUserApply(userEvent.UserApplyId); if (userApply != null) { extUserEvent.DoctorSuggest = userApply.DOCTORSUGGEST; GuideLineBLL gdBLL = new GuideLineBLL(); GuideLine guidline = gdBLL.GetSimpleModel(userApply.CURRENTNODE); if (guidline != null) { extUserEvent.CurrentNodeName = guidline.Name; extUserEvent.RecommendProcess = guidline.RecommendProcess; } } EventProductBLL epdBLL = new EventProductBLL(); extUserEvent.Products = epdBLL.GetList(p => p.EVENTID.Equals(userEvent.EventID)).ToList(); return(extUserEvent); }