public ActionResult PracticalCourseVerifyPage(int memberPCourseid)
 {
     ViewBag.Title = "实践审核";
     //小类
     Traning_CategoryBLL traning_CategoryBLL = new Traning_CategoryBLL();
     ViewBag.TraingCategoryList = traning_CategoryBLL.GetList(" Field=3 and Delflag='false'  and Display='true'", " Sort");
     //初始化model
     PracticalCourse_DetailBLL pcBLL = new PracticalCourse_DetailBLL();
     PracticalCourseEdit data = new PracticalCourseEdit();
     PracticalCourse_AttachmentBLL practicalCourse_AttachmentBLL = new PracticalCourse_AttachmentBLL();
     if ( memberPCourseid > 0)
     {
         ViewBag.Title = "实践审核";
         data = pcBLL.GetPracticeModel((int)memberPCourseid);
         ViewBag.AttachData = practicalCourse_AttachmentBLL.GetTable("Delflag=0 and Display=1 and PracticalCourseId=" + data.Id, "");
     }
     else
     {
         return RedirectToAction("PracticalCourseList", "PracticalCourse", new { area = "Practice" });
     }
     return View(data);
 }
 public ActionResult PracticalCourseAddSingle(int? memberPCourseid)
 {
     //小类
     Traning_CategoryBLL traning_CategoryBLL = new Traning_CategoryBLL();
     ViewBag.TraingCategoryList = traning_CategoryBLL.GetList(" Field=3 and Delflag='false'  and Display='true'", " Sort");
     //初始化model
     PracticalCourse_DetailBLL pcBLL = new PracticalCourse_DetailBLL();
     PracticalCourseEdit data = new PracticalCourseEdit();
     PracticalCourse_AttachmentBLL practicalCourse_AttachmentBLL = new PracticalCourse_AttachmentBLL();
     if (memberPCourseid != null && memberPCourseid > 0)
     {
         ViewBag.Type = "update";
         ViewBag.Title = "修改实践记录";
         data = pcBLL.GetPracticeModel((int)memberPCourseid);
         ViewBag.AttachData = practicalCourse_AttachmentBLL.GetTable("Delflag=0 and Display=1 and PracticalCourseId=" + data.Id, "");
     }
     else
     {
         ViewBag.Type = "insert";
         ViewBag.Title = "新增实践记录";
         ViewBag.AttachData = null;
     }
     return View(data);
 }
        public ActionResult PracticalCourseEditSingle(int? Type,int? memberPCourseid)
        {
            ViewBag.Type = Type;
            //小类
            Traning_CategoryBLL traning_CategoryBLL = new Traning_CategoryBLL();
            ViewBag.TraingCategoryList = traning_CategoryBLL.GetList(" Field=3 and Delflag='false'  and Display='true'", " Sort");
            //初始化model
            PracticalCourse_DetailBLL pcBLL = new PracticalCourse_DetailBLL();
            PracticalCourseEdit data = new PracticalCourseEdit();
            PracticalCourse_AttachmentBLL practicalCourse_AttachmentBLL = new PracticalCourse_AttachmentBLL();
            if (memberPCourseid != null && memberPCourseid > 0)
            {
                ViewBag.Group = Code.SiteCache.Instance.GroupId;
                ViewBag.Title = "修改实践记录";
                data = pcBLL.GetPracticeModel((int)memberPCourseid);
                ViewBag.AttachData = practicalCourse_AttachmentBLL.GetTable("Delflag=0 and Display=1 and PracticalCourseId=" + data.Id, "");
            }

            //Member_PracticalCourseApplicationBLL member_PracticalCourseApplicationBLL = new Member_PracticalCourseApplicationBLL();
            //List<Member_PracticalCourseApplication> mPcaList = member_PracticalCourseApplicationBLL.GetList("Delflag='false' and FlowId='" + memberPCourseid + "'", "CreateDate");
            //ViewBag.mPcaList = mPcaList;

            return View(data);
        }
        public ActionResult MyVerify(int Status, int mpId, string verifycontent)
        {
            try
            {
                Member_PracticalCourseBLL member_PracticalCourseBLL = new Member_PracticalCourseBLL();
                Member_PracticalCourse member_PracticalCourse = new Member_PracticalCourse();
                PracticalCourse_DetailBLL practicalCourse_DetailBLL = new PracticalCourse_DetailBLL();
                PracticalCourse_Detail practicalCourse_Detail = new PracticalCourse_Detail();
                member_PracticalCourse = member_PracticalCourseBLL.GetModel(mpId, "");
                practicalCourse_Detail = practicalCourse_DetailBLL.GetPracticeModel(mpId);

                //用户培训计划课程大类学时表
                if (member_PracticalCourse.Status == 1 && Status == 2 || member_PracticalCourse.Status == 3 && Status == 2)
                {
                    Member_TrainingReditBLL member_TrainingReditBLL = new Member_TrainingReditBLL();
                    List<Member_TrainingRedit> Listmember_TrainingRedit = member_TrainingReditBLL.GetList(" TrainingField=3 and Delflag='false' and PlanId='" + practicalCourse_Detail.PlanId + "' and AccountId='" + member_PracticalCourse.AccountId + "' ", "");
                    if (Listmember_TrainingRedit == null || Listmember_TrainingRedit.Count == 0)
                    {
                        Member_TrainingRedit member_TrainingRedit = new Member_TrainingRedit();
                        member_TrainingRedit.TrainingField = 3;
                        member_TrainingRedit.PlanId = practicalCourse_Detail.PlanId;
                        member_TrainingRedit.AccountId = member_PracticalCourse.AccountId;
                        PracticalCourse_RoleCreditsBLL practicalCourse_RoleCreditsBLL = new PracticalCourse_RoleCreditsBLL();
                        member_TrainingRedit.Credits = practicalCourse_RoleCreditsBLL.GetList(" TraingField=3 and TraingCategory='" + practicalCourse_Detail.TraingCategory.ToInt() + "' and TraingTopic='" + practicalCourse_Detail.TraingTopic.ToInt() + "' and RoleId='" + Convert.ToInt32(member_PracticalCourse.RoleId) + "'", "")[0].Credits;
                        member_TrainingRedit.Delflag = false;
                        member_TrainingRedit.CreateDate = DateTime.Now;
                        member_TrainingReditBLL.Add(member_TrainingRedit);
                    }
                    else
                    {
                        Member_TrainingRedit member_TrainingRedit = Listmember_TrainingRedit[0];
                        PracticalCourse_RoleCreditsBLL practicalCourse_RoleCreditsBLL = new PracticalCourse_RoleCreditsBLL();
                        member_TrainingRedit.Credits += practicalCourse_RoleCreditsBLL.GetList(" TraingField=3 and TraingCategory='" + practicalCourse_Detail.TraingCategory.ToInt() + "' and TraingTopic='" + practicalCourse_Detail.TraingTopic.ToInt() + "' and RoleId='" + Convert.ToInt32(member_PracticalCourse.RoleId) + "'", "")[0].Credits;
                        member_TrainingReditBLL.Update(member_TrainingRedit);
                    }
                }
                else if (member_PracticalCourse.Status == 2 && Status == 3)
                {
                    Member_TrainingReditBLL member_TrainingReditBLL = new Member_TrainingReditBLL();
                    List<Member_TrainingRedit> Listmember_TrainingRedit = new List<Member_TrainingRedit>();
                    Listmember_TrainingRedit = member_TrainingReditBLL.GetList(" TrainingField=3 and Delflag='false' and PlanId='" + practicalCourse_Detail.PlanId + "' and AccountId='" + member_PracticalCourse.AccountId + "' ", "");

                    Member_TrainingRedit member_TrainingRedit = Listmember_TrainingRedit[0];
                    PracticalCourse_RoleCreditsBLL practicalCourse_RoleCreditsBLL = new PracticalCourse_RoleCreditsBLL();
                    member_TrainingRedit.Credits -= practicalCourse_RoleCreditsBLL.GetList(" TraingField=3 and TraingCategory='" + practicalCourse_Detail.TraingCategory.ToInt() + "' and TraingTopic='" + practicalCourse_Detail.TraingTopic.ToInt() + "' and RoleId='" + Convert.ToInt32(member_PracticalCourse.RoleId) + "'", "")[0].Credits;
                    member_TrainingReditBLL.Update(member_TrainingRedit);
                }

                member_PracticalCourse.Status = Status;
                member_PracticalCourse.ApplyRemark = verifycontent;
                member_PracticalCourseBLL.Update(member_PracticalCourse);

                Member_PracticalCourseApplicationBLL member_PracticalCourseApplicationBLL = new Member_PracticalCourseApplicationBLL();
                Member_PracticalCourseApplication member_PracticalCourseApplication = new Member_PracticalCourseApplication();
                member_PracticalCourseApplication.FlowId = mpId;
                member_PracticalCourseApplication.Status = Status;
                member_PracticalCourseApplication.Remark = verifycontent;
                member_PracticalCourseApplication.Creater = Code.SiteCache.Instance.LoginInfo.UserId;
                member_PracticalCourseApplication.AccountId = member_PracticalCourse.AccountId;
                member_PracticalCourseApplication.Delflag = false;
                member_PracticalCourseApplication.CreateDate = DateTime.Now;
                member_PracticalCourseApplicationBLL.Add(member_PracticalCourseApplication);

                TempData["Msg"] = "提交成功!";
                return RedirectToAction("../../Practice/PracticalCourse/PracticalCourseList");
            }
            catch (Exception)
            {
                TempData["Msg"] = "提交失败!";
                return RedirectToAction("../../Practice/PracticalCourse/PracticalCourseList");
            }
        }