コード例 #1
0
 public IHttpActionResult Post([FromBody] Request <HR_CNR_USER> request)
 {
     try
     {
         var model = request.Data;
         if (!string.IsNullOrEmpty(model.USERID))
         {
             model.MODIFYTIME = DateTime.Now;
             _repository.Update(model);
         }
         else
         {
             model.USERID    = Guid.NewGuid().ToString();
             model.CREATTIME = DateTime.Now;
             if (!string.IsNullOrEmpty(model.IDCARD))
             {
                 PersonInfo person = personRepostitory.Get(model.IDCARD);
                 if (person != null)
                 {
                     model.PERSONID = person.PersonId.ToString();
                 }
             }
             _repository.Insert(model);
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError(ex.ToString());
         return(BadRequest(ex.Message));
     }
     return(Ok());
 }
コード例 #2
0
ファイル: UserController.cs プロジェクト: x55756016/kmproject
        /// <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);
        }