Example #1
0
        public ActionResult AddHonor()
        {
            string jsonTxt                   = "";
            string dataSize                  = Request["honorCommitJson"];
            JavaScriptSerializer jss         = new JavaScriptSerializer();
            HonorInfo            perInfoSize = jss.Deserialize <HonorInfo>(dataSize);

            try
            {
                if (perInfoSize != null)
                {
                    //HonorInfo honorInfo = new HonorInfo();
                    //List<HonorPerson> honorInfoList = new List<HonorPerson>();
                    honor honorinfo = new honor();
                    honorinfo.vcHonorName         = perInfoSize.HonorName;
                    honorinfo.vcGuideTeacher      = perInfoSize.GuidTeacher;
                    honorinfo.vcNetConnectAddress = perInfoSize.NetConnect;
                    honorinfo.vcHonorIntroduce    = perInfoSize.HonorIntroduce;
                    honorinfo.vcTechnicalType     = perInfoSize.TechnicalType;

                    honorinfo.dSubmitTime    = DateTime.Now;
                    honorinfo.IsDel          = false;
                    honorinfo.bReviewOfWorks = true;//作品是否审核   不能这样做

                    var teaminfo = TeamService.LoadEntities(t => t.vcTeamName == perInfoSize.HonorTeam).FirstOrDefault();
                    honorinfo.iTeamID = teaminfo.ID;
                    var addHonor = HonorService.AddEntity(honorinfo);
                    if (addHonor != null)
                    {
                        string   personNumList = perInfoSize.userAccount;
                        string[] personNumAll  = personNumList.Split(',');
                        //添加成员  往荣耀参与成员表中添加数据
                        foreach (string Num in personNumAll)
                        {
                            honorparticipantmember honorper = new honorparticipantmember();
                            honorper.iHonorID        = addHonor.ID;
                            honorper.iUserID         = Convert.ToInt32(Num);
                            honorper.vcNonTeamMember = perInfoSize.NonMember;
                            honorper.IsDel           = false;
                            if (HonorparticipantmemberService.AddEntity(honorper) != null)
                            {
                                continue;
                            }
                        }
                        status  = "ok";
                        result  = "添加成功";
                        jsonTxt = "{" + "\"" + "status" + "\"" + ":" + "\"" + status + "\"" + "," + "\"" + "result" + "\"" + ":" + "\"" + result + "\"," + "\"" + "honorId" + "\"" + ":" + "\"" + addHonor.ID.ToString() + "\"" + "}";
                    }
                    else
                    {
                        status  = "no";
                        result  = "添加失败";
                        jsonTxt = "{" + "\"" + "status" + "\"" + ":" + "\"" + status + "\"" + "," + "\"" + "result" + "\"" + ":" + "\"" + result + "\"" + "}";
                    }
                }
                else
                {
                    status  = "no";
                    result  = "添加失败";
                    jsonTxt = "{" + "\"" + "status" + "\"" + ":" + "\"" + status + "\"" + "," + "\"" + "result" + "\"" + ":" + "\"" + result + "\"" + "}";
                }
            }
            catch (Exception ex)
            {
                status  = "no";
                result  = "添加失败";
                jsonTxt = "{" + "\"" + "status" + "\"" + ":" + "\"" + status + "\"" + "," + "\"" + "result" + "\"" + ":" + "\"" + result + "\"" + "}";
            }
            return(Content(jsonTxt));
        }
Example #2
0
        /// <summary>
        /// 审核荣耀结果
        /// </summary>
        /// <returns></returns>
        public ActionResult HonorAuditByTeacher()
        {
            string suggestion = Request.QueryString["suggistion"];
            int    honorId    = Convert.ToInt32(Request.QueryString["id"]);

            if (suggestion == "agree")
            {
                try
                {
                    var honorList = honorService.LoadEntities(h => h.ID == honorId).FirstOrDefault();
                    honorList.bReviewOfWorks = true;
                    if (honorList != null)
                    {
                        honor honorInfo = new honor();
                        honorInfo.ID                   = honorList.ID;
                        honorInfo.vcHonorName          = honorList.vcHonorName;
                        honorInfo.dSubmitTime          = honorList.dSubmitTime;
                        honorInfo.vcHonorIntroduce     = honorList.vcHonorIntroduce;
                        honorInfo.vcGuideTeacher       = honorList.vcGuideTeacher;
                        honorInfo.vcHonorSubmitAddress = honorList.vcHonorSubmitAddress;
                        honorInfo.vcHonorSliderAddress = honorList.vcHonorSliderAddress;
                        honorInfo.vcPreviewAddress     = honorList.vcPreviewAddress;
                        honorInfo.vcNetConnectAddress  = honorList.vcNetConnectAddress;
                        honorInfo.vcDownLoadAddress    = honorList.vcDownLoadAddress;
                        honorInfo.vcTechnicalType      = honorList.vcTechnicalType;
                        honorInfo.bReviewOfWorks       = honorList.bReviewOfWorks;//审核
                        honorInfo.iTeamID              = honorList.iTeamID;
                        honorInfo.bDownLoadUnable      = honorList.bDownLoadUnable;
                        honorInfo.IsDel                = honorList.IsDel;
                        try
                        {
                            if (honorService.EditEntity(honorInfo))
                            {
                                status = "ok";
                                mess   = "审核通过";
                            }
                            else
                            {
                                status = "fail";
                                mess   = "审核不通过";
                            }
                        }
                        catch (Exception)
                        {
                            status = "fail";
                            mess   = "网络连接不稳定,请稍后再试";
                        }
                    }
                }
                catch (Exception)
                {
                    status = "fail";
                    mess   = "网络连接不稳定,请稍后再试";
                }
            }
            if (suggestion == "disagress")
            {
                status = "fail";
                mess   = "审核不通过";
            }
            result = "{" + "\"" + "status" + "\"" + ":" + "\"" + status + "\"" + "," + "\"" + "msg" + "\"" + ":" + "\"" + mess + "\"" + "}";
            return(Content(result));
        }