예제 #1
0
        /// <summary>
        /// 审核通过
        /// </summary>
        /// <param name="id"></param>
        /// <param name="bussiness"></param>
        /// <returns></returns>
        public IActionResult PassApprove(int id, int bussiness, int inStanceId)
        {
            string        user          = HttpContext.Session.GetString("user");
            UserAndRole   userAndRole   = JsonConvert.DeserializeObject <UserAndRole>(user);
            int           userID        = userAndRole.ID;
            Approve       approve       = _approve.GetApproveById(id);
            Instance      instance      = _policeCase.GetInstanceById(inStanceId);
            ApproveCourse approveCourse = new ApproveCourse();

            if (approve.PlaceID != 0)
            {
                approveCourse = _approve.GetApproveCoursesList(approve.PlaceID);
                string str = approveCourse.Condition;
                if (!str.Contains(instance.InstanceState.ToString()))
                {
                    approve.PlaceID = 0;
                }
            }
            //approve.Ideas = "";
            //approve.State = "2";
            //approve.ApprovePeopleId = userID;
            //approve.Time = DateTime.Now;
            //int i = _approve.UpdateApprove(approve);
            //if (i > 0)
            //{
            if (approve.PlaceID == 0)
            {
                approve.Ideas           = "";
                approve.State           = "2";
                approve.ApprovePeopleId = userID;
                approve.Time            = DateTime.Now;
                int result = _approve.UpdateApprove(approve);
                if (result > 0)
                {
                    //Instance instance = _policeCase.GetInstanceById(inStanceId);
                    instance.ApproveState = 2;
                    int a = _policeCase.UpdateinStance(instance);
                    if (a > 0)
                    {
                        return(Content("<script>alert('审核通过!');location.href='/BackWebSet/Index'</script>", "text/html;charset=utf-8"));
                    }
                }
            }
            else
            {
                //ApproveCourse approveCourse = _approve.GetApproveCoursesList(approve.PlaceID);
                //Approve approves = new Approve() { BusinesstypeId = approve.BusinesstypeId, OriginalId = approve.OriginalId, PlaceID = approveCourse.PostpositionID, RoleId = approveCourse.ApproveRoleId, State = "1" };
                approve.PlaceID = approveCourse.PostpositionID;
                approve.RoleId  = approveCourse.ApproveRoleId;
                int result = _approve.UpdateApprove(approve);
                if (result > 0)
                {
                    return(Content("<script>alert('您的审核通过!正在进行下一级审核');location.href='/BackWebSet/Index'</script>", "text/html;charset=utf-8"));
                }
            }
            //}
            return(View());
        }
예제 #2
0
        public void OverInstance(int id)
        {
            Instance instance = _policeCase.GetInstanceById(id);

            instance.InstanceTypes = 2;
            instance.ApproveState  = 1;
            Approve approve = _policeCase.GetApprove(instance);
            int     result  = _approve.InsertApprove(approve);

            if (result > 0)
            {
                int i = _policeCase.UpdateinStance(instance);
                if (i > 0)
                {
                    Response.WriteAsync("<script>alert('申请结案成功!')</script>");
                }
                else
                {
                    Response.WriteAsync("<script>alert('案件转型失败!')</script>");
                }
            }
            else
            {
                Response.WriteAsync("<script>alert('申请结案失败!')</script>");
            }
        }