Exemplo n.º 1
0
        public ActionResult RemoveForm(string keyValue)
        {
            OccupationalstaffdetailBLL occupationalstaffdetailbll = new OccupationalstaffdetailBLL();

            occupationalstaffdetailbll.Delete(keyValue, 0);//先删除其下详情数据
            occupationalstaffdetailbll.Delete(keyValue, 1);
            occupatioalstaffbll.RemoveForm(keyValue);
            return(Success("删除成功。"));
        }
Exemplo n.º 2
0
        public ActionResult SaveForm(string keyValue, string strentity, string Users, string UserIds, bool isNew)
        {
            OccupatioalstaffEntity userEntity = strentity.ToObject <OccupatioalstaffEntity>();

            #region 处理体检员工表
            //先查询出患病的用户
            OccupationalstaffdetailBLL occupationalstaffdetailbll = new OccupationalstaffdetailBLL();
            IEnumerable <OccupationalstaffdetailEntity> odlist    = occupationalstaffdetailbll.GetList(keyValue, 1); //查询出所有填写的患病记录
            IEnumerable <OccupationalstaffdetailEntity> yclist    = occupationalstaffdetailbll.GetList(keyValue, 2); //查询出所有填写的异常记录
            occupationalstaffdetailbll.UpdateTime((DateTime)(userEntity.InspectionTime), keyValue);                  //先将所有的病人体检时间纠正过来
            if (!isNew)                                                                                              //修改模式
            {
                occupationalstaffdetailbll.Delete(keyValue, 0);                                                      //先把健康人员记录删除再重新添加
            }
            //获取到所有体检用户
            string[] UserGroup  = UserIds.Split(',');
            string[] UsersGroup = Users.Split(',');
            if (odlist != null)
            {
                for (int i = 0; i < UserGroup.Length; i++)
                {
                    if (!IsTrue(odlist, yclist, UserGroup[i]))
                    {
                        //判断为健康员工
                        OccupationalstaffdetailEntity occ = new OccupationalstaffdetailEntity();
                        occ.UserId         = UserGroup[i];
                        occ.UserName       = UsersGroup[i];
                        occ.UserNamePinYin = Str.PinYin(UsersGroup[i]);
                        occ.Note           = "";
                        occ.Issick         = 0;
                        occ.InspectionTime = userEntity.InspectionTime;
                        occ.OccId          = keyValue;
                        occ.SickType       = "无";
                        occupationalstaffdetailbll.SaveForm("", occ);
                    }
                }
            }
            #endregion
            FileInfoBLL file = new FileInfoBLL();
            DataTable   dt   = file.GetFiles(keyValue);//先获取上传的附件
            if (dt != null && dt.Rows.Count > 0)
            {
                userEntity.IsAnnex = 1;//有附件
            }
            else
            {
                userEntity.IsAnnex = 0;//没有附件
            }
            userEntity.OccId         = keyValue;
            userEntity.InspectionNum = UserGroup.Length;
            userEntity.PatientNum    = odlist.Count();
            userEntity.UnusualNum    = yclist.Count();

            occupatioalstaffbll.SaveForm(isNew, userEntity);
            return(Success("操作成功。"));
        }