[ValidateAntiForgeryToken] //传入

        public ActionResult AddArchive(int?securityName, string hezai, string totallong, string zaojia, string Fee, int?retentionPeriodName, string structureTypeID, long paperProjectSeqNo, string action, string RegistrationNo, string archivesNo, string shizhengNo, string licenseNo, string mapsheetNo, string microNo, string buildingArea, string archivesTitle, string firstResponsible, string responsibleOther, string developmentOrganization, string transferUnit, string disignOrganization, string PaiJiaNo, string constructionOrganization, string TextMaterial, string drawing, string PhotoCount, string ArchiveThickness, string bianzhiTime, string jgDate, string Material, string location, string remarks, string newLocation, string overground, string underground, int?changeLog, string fazhaoTime, string jungongTime, string kaigongTime, string indexer, string indexeDate, string checker, string checkDate, string Typist, string TyperDate)
        {
            if (action == "返回")
            {
                return(RedirectToAction("ArchiveMaga"));
            }
            var papaerarchive = from a in cb.gxPaperArchives
                                where a.paperProjectSeqNo == paperProjectSeqNo
                                select a;
            gxPaperArchives paperArchives = papaerarchive.First();
            long            ID            = Convert.ToInt32(paperArchives.projectID);
            var             projectInfo   = from b in cb.gxProjectInfo
                                            where b.projectID == ID
                                            select b;
            gxProjectInfo    projects = projectInfo.First();
            gxArchivesDetail archive  = new gxArchivesDetail();
            //var SEQNO = cb.vw_gxpassList.Where(a => a.paperProjectSeqNo == paperProjectSeqNo).Where(a=>a.classifyID.Trim()=="1").First().paperProjectSeqNo;
            gxArchivesDetail archive1 = cb.gxArchivesDetail.Where(a => a.paperProjectSeqNo == paperProjectSeqNo).OrderByDescending(a => a.volNo).First();

            archive.registrationNo    = RegistrationNo;
            archive.archivesNo        = archivesNo;
            archive.paperProjectSeqNo = paperProjectSeqNo;

            archive.volNo            = archive1.volNo;
            archive1.volNo           = archive1.volNo + 1;
            archive.paijiaNo         = PaiJiaNo.Trim();
            archive.archiveThickness = Convert.ToInt32(ArchiveThickness);

            if (TextMaterial.Trim() != "")
            {
                archive.textMaterial = Int32.Parse(TextMaterial.Trim()); //文字材料
            }
            archive.archivesTitle    = archivesTitle;                    //案卷提名
            archive.firstResponsible = firstResponsible;                 //第一负责人

            if (drawing.Trim() != "")
            {
                archive.drawing = Int32.Parse(drawing.Trim()); //图纸
            }
            if (PhotoCount.Trim() != "")                       //照片
            {
                archive.photoCount = Int32.Parse(PhotoCount.Trim());
            }
            archive.responsibleOther = responsibleOther;//其他责任者


            archive.developmentUnit  = developmentOrganization;
            archive.constructionUnit = constructionOrganization;
            archive.designUnit       = disignOrganization;

            archive.bianzhiTime = bianzhiTime.Trim(); //编制日期
            //archive.bianzhiTime = DateTime.ParseExact(strbianzhiTime, "yyyy-MM-dd", null).Date;
            archive.transferUnit = transferUnit;      //移交单位
            archive.notearea     = location;          //附注改为工程地址
            archive.licenseNo    = licenseNo;         //执照号
            archive.shizhengNo   = shizhengNo;        //市政档案号

            archive.remarks = remarks;                //备注
            string strbiaoyinriqi = indexeDate;       //标引日期

            archive.indexDate = DateTime.Parse(strbiaoyinriqi);
            archive.indexer   = indexer;//标引员


            string strshenheriqi = checkDate;//审核日期

            archive.checkDate = DateTime.Parse(strshenheriqi);
            archive.checker   = checker;              //审核员

            archive.kaigongTime = kaigongTime.Trim(); //开工日期
            archive.jungongTime = jungongTime.Trim(); //竣工日期
            archive.fazhaoTime  = fazhaoTime.Trim();  //发照日期
            if (jgDate != null)
            {
                archive.jgDate = DateTime.Parse(jgDate.Trim());
            }
            string strlururiqi = TyperDate;//录入日期

            if (strlururiqi != null)
            {
                archive.typerDate = DateTime.Parse(strlururiqi);
            }
            archive.typist = Typist;//录入员

            archive.isImageExist = "无";
            if (mapsheetNo == "")
            {
                archive.mapsheetNo = "0";
            }
            else
            {
                archive.mapsheetNo = mapsheetNo;//图幅号
            }
            if (microNo == "")
            {
                archive.microNo = "0";
            }
            else
            {
                archive.microNo = microNo;//微缩号
            }

            if (ModelState.IsValid)
            {
                cb.Entry(archive1).State = EntityState.Modified;
                cb.gxArchivesDetail.Add(archive);
                cb.SaveChanges();
            }

            //if (projects != null)
            //{
            //    if (projects.developmentOrganization.Trim() != developmentOrganization.Trim() || projects.constructionOrganization.Trim() != constructionOrganization.Trim() || projects.disignOrganization.Trim() != disignOrganization.Trim())
            //    {
            //        if (developmentOrganization.Trim() != "")
            //            projects.developmentOrganization = developmentOrganization.Trim();
            //        if (constructionOrganization.Trim() != "")
            //            projects.constructionOrganization = constructionOrganization.Trim();
            //        if (disignOrganization.Trim() != "")
            //            projects.disignOrganization = disignOrganization.Trim();

            //    }
            //    projects.securityID = securityName.ToString().Trim();
            //    projects.retentionPeriodNo = retentionPeriodName.ToString().Trim();
            //    projects.structureTypeID = structureTypeID.ToString().Trim();
            //    projects.newLocation = newLocation.Trim();
            //    if (ModelState.IsValid)
            //    {
            //        cb.Entry(projects).State = EntityState.Modified;
            //        cb.SaveChanges();
            //    }
            //}
            if (paperArchives != null)
            {
                string jinguandata = Convert.ToDateTime(paperArchives.jgDate).ToString("yyyy-MM-dd");
                if (jinguandata != jgDate.Trim())
                {
                    paperArchives.jgDate = DateTime.Parse(jgDate.Trim());
                }
                paperArchives.structureTypeID = structureTypeID.ToString().Trim();
                paperArchives.buildingArea    = Convert.ToDouble((buildingArea.Trim()));
                paperArchives.underground     = underground.Trim();
                paperArchives.overground      = overground.Trim();
                paperArchives.Fee             = Fee;
                paperArchives.zaojia          = zaojia;
                paperArchives.Material        = Material;
                paperArchives.totallong       = totallong;
                paperArchives.hezai           = hezai;
                if (Material == null)
                {
                    Material = "";
                }
                if (Material.Trim() != "")
                {
                    paperArchives.Material = Material.Trim();
                }

                paperArchives.luruTime          = TyperDate.Trim();
                paperArchives.projectStartDate  = kaigongTime.Trim();
                paperArchives.projectFinishDate = jungongTime.Trim();
                paperArchives.licenseNo         = licenseNo.Trim();
                paperArchives.licenseDate       = fazhaoTime.Trim();
                if (changeLog == 0)
                {
                    paperArchives.changeLog = "没有";
                }
                if (changeLog == 1)
                {
                    paperArchives.changeLog = "有";
                }


                paperArchives.transferUnit = transferUnit;
                if (TextMaterial.Trim() != "")
                {
                    if (paperArchives.textMaterial != 0)
                    {
                        paperArchives.textMaterial = paperArchives.textMaterial + Int32.Parse(TextMaterial.Trim());
                    }
                    else
                    {
                        paperArchives.textMaterial = Int32.Parse(TextMaterial.Trim());
                    }
                }
                if (TextMaterial.Trim() != "")
                {
                    if (paperArchives.drawing != 0)
                    {
                        paperArchives.drawing = paperArchives.drawing + Int32.Parse(TextMaterial.Trim());
                    }
                    else
                    {
                        paperArchives.drawing = Int32.Parse(TextMaterial.Trim());
                    }
                }
                if (PhotoCount.Trim() != "")
                {
                    if (paperArchives.PhotoCount != 0)
                    {
                        paperArchives.PhotoCount = paperArchives.PhotoCount + Int32.Parse(PhotoCount.Trim());
                    }
                    else
                    {
                        paperArchives.PhotoCount = Int32.Parse(PhotoCount.Trim());
                    }
                }
                paperArchives.firstResponsible = firstResponsible.Trim();
                paperArchives.responsibleOther = responsibleOther.Trim();


                string shizhengno = shizhengNo.Trim();
                paperArchives.archivesCount = (int.Parse(paperArchives.archivesCount) + 1).ToString();
                //int volCount = 0;
                //int.TryParse(paperArchives.archivesCount, out volCount);
                int vol = Convert.ToInt32(archive.volNo);

                if (vol == 1)
                {
                    paperArchives.shizhengNoStart = shizhengno;
                }
                if (vol == int.Parse(paperArchives.archivesCount))
                {
                    paperArchives.shizhengNoEnd = shizhengno;
                }

                if (ModelState.IsValid)
                {
                    cb.Entry(paperArchives).State = EntityState.Modified;
                    cb.SaveChanges();
                    return(Content("<script >alert('保存成功!');window.location.href='/gxArchiveManagement/AddArchive';</script >"));
                }
            }
            return(View());
        }
        [ValidateAntiForgeryToken] //传入
        public ActionResult FaFangHeGeZheng(string archiveCertificateNo, long projectID, string workUnit, string lingquPerson, string contractTel, string fafangPeroson, DateTime?lingquDate, string isFafangHegezheng, string action)
        {
            if (action == "返回")
            {
                return(RedirectToAction("MeterialsSend"));
            }

            var project = from b in ab.gxProjectInfo
                          where b.projectID == projectID
                          select b;
            gxProjectInfo d            = project.First();
            var           paperArchive = from f in ab.gxPaperArchives
                                         where f.projectID == projectID
                                         select f;
            gxPaperArchives g = paperArchive.First();

            if (action == "确定")
            {
                gxFafangArchiveCertificate fafang = new gxFafangArchiveCertificate();
                fafang.workUnit      = workUnit;
                fafang.lingquPerson  = lingquPerson;
                fafang.contractTel   = contractTel;
                fafang.fafangPeroson = fafangPeroson;
                string str = Convert.ToDateTime(lingquDate).ToString("yyyy-MM-dd");
                fafang.lingquDate = DateTime.ParseExact(str.Trim(), "yyyy-MM-dd", null).Date;
                fafang.projectID  = projectID;
                var maxid = ab.gxLingquInterchangeForm.Max(a => a.ID);
                fafang.ID              = maxid + 1;
                d.isFafangHegezheng    = true;
                g.archiveCertificateNo = archiveCertificateNo;
                ab.gxFafangArchiveCertificate.Add(fafang);
                ab.Entry(d).State = EntityState.Modified;
                ab.Entry(g).State = EntityState.Modified;
                ab.SaveChanges();
                return(Content("<script >alert('确认成功');window.history.back();</script >"));
            }
            if (action == "更新")
            {
                var vwArchiveList = from a in ab.gxFafangArchiveCertificate
                                    where a.projectID == projectID
                                    select a;
                if (vwArchiveList.Count() == 0)
                {
                    return(Content("<script >alert('请先领取');window.history.back();</script >"));
                }
                gxFafangArchiveCertificate c = vwArchiveList.First();
                c.workUnit      = workUnit;
                c.lingquPerson  = lingquPerson.Trim();
                c.contractTel   = contractTel.Trim();
                c.fafangPeroson = fafangPeroson.Trim();
                string str = Convert.ToDateTime(lingquDate).ToString("yyyy-MM-dd");
                c.lingquDate = DateTime.ParseExact(str.Trim(), "yyyy-MM-dd", null).Date;

                if (isFafangHegezheng.ToString() == "True")
                {
                    d.isFafangHegezheng = true;
                }
                else
                {
                    d.isFafangHegezheng = false;
                }
                ab.Entry(c).State = EntityState.Modified;
                ab.Entry(d).State = EntityState.Modified;
                ab.SaveChanges();
                return(Content("<script >alert('修改成功');window.history.back();</script >"));
            }


            return(View());
        }
示例#3
0
        public ActionResult Index(int id, string uuid)
        {
            //string uuid = "297d413364dc4e7d81e5858c1bfcfbb5";
            var test = from ad in db.ArchivesDetail
                       where (ad.UUID == uuid)
                       select ad;

            if (test.Count() == 0)
            {
                var test1 = from ad in bb.gxArchivesDetail
                            where (ad.UUID == uuid)
                            select ad;

                if (test1.Count() == 0)
                {
                    return(HttpNotFound());;
                }
                //管线数据
                gxArchivesDetail gxArchivesDetail  = test1.First();
                long             paperProjectSeqNo = gxArchivesDetail.paperProjectSeqNo;
                var n = from a in bb.gxPaperArchives
                        where a.paperProjectSeqNo == paperProjectSeqNo
                        select a;
                gxPaperArchives gxPaperArchives = n.First();

                var n1 = from a in bb.gxProjectInfo
                         where a.projectID == gxPaperArchives.projectID
                         where a.isNB == "外部"
                         select a;
                gxProjectInfo gxProjectInfo = n1.First();

                ViewBag.projectName              = gxProjectInfo.projectName;              //工程名称
                ViewBag.location                 = gxProjectInfo.location;                 //工程地点
                ViewBag.developmentOrganization  = gxProjectInfo.developmentOrganization;  //建设单位
                ViewBag.devolonpentOrgContacter  = gxProjectInfo.devolonpentOrgContacter;  //建设单位联系人
                ViewBag.mobilephoneNoDevelopment = gxProjectInfo.mobilephoneNoDevelopment; //建设单位联系人电话

                ViewBag.constructionOrganization = gxProjectInfo.constructionOrganization; //施工单位
                ViewBag.constructionOrgContacter = gxProjectInfo.constructionOrgContacter; //施工单位法人
                ViewBag.telphoneNoDevelopment    = gxProjectInfo.telphoneNoDevelopment;    //施工单位电话

                ViewBag.disignOrganization   = gxProjectInfo.disignOrganization;           //设计单位
                ViewBag.designOrgaContacter  = gxProjectInfo.designOrgaContacter;          //设计单位联系人
                ViewBag.telphoneNoDesignOrga = gxProjectInfo.telphoneNoDesignOrga;         //设计者

                ViewBag.jianliUnit           = gxProjectInfo.jianliUnit;                   //监理单位
                ViewBag.jianliUnitContacter  = gxProjectInfo.jianliUnitContacter;          //监理单位负责人
                ViewBag.telphoneNoJianliUnit = gxProjectInfo.telphoneNoJianliUnit;         //监理者

                ViewBag.Kcdw     = gxProjectInfo.Kcdw;                                     //勘察单位
                ViewBag.Kcdwlxr  = gxProjectInfo.Kcdwlxr;                                  //勘察单位负责人
                ViewBag.Kcdwlxdh = gxProjectInfo.Kcdwlxdh;                                 //勘察单位电话


                //ViewBag.jgdate = Convert.ToDateTime(gxArchivesDetail.jgDate).ToString("yyyy-MM-dd");//进馆时间
                ViewBag.kaigongTime      = Convert.ToDateTime(gxArchivesDetail.kaigongTime).ToString("yyyy-MM-dd"); //开工时间
                ViewBag.jungongTime      = Convert.ToDateTime(gxArchivesDetail.jungongTime).ToString("yyyy-MM-dd"); //竣工时间
                ViewBag.archivesTitle    = gxArchivesDetail.archivesTitle;                                          //案卷题名
                ViewBag.firstResponsible = gxArchivesDetail.firstResponsible;                                       //责任者
                ViewBag.bianzhiTime      = gxArchivesDetail.bianzhiTime;                                            //编制时间
                ViewBag.indexer          = gxArchivesDetail.indexer;                                                //立卷人
                ViewBag.indexDate        = Convert.ToDateTime(gxArchivesDetail.indexDate).ToString("yyyy-MM-dd");;  //立卷时间
                ViewBag.key1             = gxArchivesDetail.key1;                                                   //主题词
                ViewBag.remarks          = gxArchivesDetail.remarks;                                                //备注

                var gxfileInfo = from ad in bb.gxFileInfo
                                 select ad;
                gxfileInfo     = gxfileInfo.Where(ad => ad.archivesNo.ToString().Equals(gxArchivesDetail.archivesNo));//根据档号搜索
                gxfileInfo     = gxfileInfo.OrderBy(s => s.ID).Take(1000);
                ViewBag.result = JsonConvert.SerializeObject(gxfileInfo);
                return(View());
            }
            else
            {
                //竣工数据
                ArchivesDetail ArchivesDetail    = test.First();
                long           paperProjectSeqNo = ArchivesDetail.paperProjectSeqNo;
                var            n = from a in db.PaperArchives
                                   where a.paperProjectSeqNo == paperProjectSeqNo
                                   select a;
                if (n.Count() == 0)
                {
                    return(Content("<script >alert('找不到工程文件!');</script >"));
                }
                PaperArchives PaperArchives = n.First();

                var n1 = from a in db.ProjectInfo
                         where a.projectID == PaperArchives.projectID
                         select a;
                ProjectInfo ProjectInfo = n1.First();

                ViewBag.projectName              = ProjectInfo.projectName;              //工程名称
                ViewBag.location                 = ProjectInfo.location;                 //工程地点
                ViewBag.developmentOrganization  = ProjectInfo.developmentOrganization;  //建设单位
                ViewBag.devolonpentOrgContacter  = ProjectInfo.devolonpentOrgContacter;  //建设单位联系人
                ViewBag.mobilephoneNoDevelopment = ProjectInfo.mobilephoneNoDevelopment; //建设单位联系人电话

                ViewBag.constructionOrganization = ProjectInfo.constructionOrganization; //施工单位
                ViewBag.constructionOrgContacter = ProjectInfo.constructionOrgContacter; //施工单位法人
                ViewBag.telphoneNoDevelopment    = ProjectInfo.telphoneNoDevelopment;    //施工单位电话

                ViewBag.disignOrganization   = ProjectInfo.disignOrganization;           //设计单位
                ViewBag.designOrgaContacter  = ProjectInfo.designOrgaContacter;          //设计单位联系人
                ViewBag.telphoneNoDesignOrga = ProjectInfo.telphoneNoDesignOrga;         //设计者

                ViewBag.jianliUnit           = ProjectInfo.jianliUnit;                   //监理单位
                ViewBag.jianliUnitContacter  = ProjectInfo.jianliUnitContacter;          //监理单位负责人
                ViewBag.telphoneNoJianliUnit = ProjectInfo.telphoneNoJianliUnit;         //监理者

                ViewBag.Kcdw     = ProjectInfo.Kcdw;                                     //勘察单位
                ViewBag.Kcdwlxr  = ProjectInfo.Kcdwlxr;                                  //勘察单位负责人
                ViewBag.Kcdwlxdh = ProjectInfo.Kcdwlxdh;                                 //勘察单位电话


                //ViewBag.jgdate = Convert.ToDateTime(ArchivesDetail.jgDate).ToString("yyyy-MM-dd");//进馆时间
                ViewBag.kaigongTime      = Convert.ToDateTime(ArchivesDetail.kaigongTime).ToString("yyyy-MM-dd"); //开工时间
                ViewBag.jungongTime      = Convert.ToDateTime(ArchivesDetail.jungongTime).ToString("yyyy-MM-dd"); //竣工时间
                ViewBag.archivesTitle    = ArchivesDetail.archivesTitle;                                          //案卷题名
                ViewBag.firstResponsible = ArchivesDetail.firstResponsible;                                       //责任者
                ViewBag.bianzhiTime      = ArchivesDetail.bianzhiTime;                                            //编制时间
                ViewBag.indexer          = ArchivesDetail.indexer;                                                //立卷人
                ViewBag.indexDate        = Convert.ToDateTime(ArchivesDetail.indexDate).ToString("yyyy-MM-dd");;  //立卷时间
                ViewBag.key1             = ArchivesDetail.key1;                                                   //主题词
                ViewBag.remarks          = ArchivesDetail.remarks;                                                //备注

                var fileInfo = from ad in db.FileInfo
                               select ad;
                fileInfo       = fileInfo.Where(ad => ad.archivesNo.ToString().Equals(ArchivesDetail.archivesNo));//根据档号搜索
                fileInfo       = fileInfo.OrderBy(s => s.id).Take(1000);
                ViewBag.result = JsonConvert.SerializeObject(fileInfo);

                if (ArchivesDetail == null)
                {
                    return(HttpNotFound());
                }
                return(View());
            }
        }
        public ActionResult SeeSettle([Bind(Include = "InchCountDetail,characterVolumeCount,character2cm,character3cm,character4cm,character5cm,originalVolumeCount,originalInchCount,drawingVolumeCount,drawing2cm,drawing3cm,drawing4cm,drawing5cm,copyInchCount")] vw_archiveQueryList archiveQueryList, string action, long?id)
        {
            var paper = from ad in bb.gxPaperArchives
                        where (ad.projectID == id)
                        select ad;
            gxPaperArchives paperArchive = paper.First();
            var             project      = from ac in bb.gxProjectInfo
                                           where (ac.projectID == id)
                                           select ac;
            gxProjectInfo projectinfo = project.First();

            paperArchive.InchCountDetail = archiveQueryList.InchCountDetail;

            paperArchive.character2cm = archiveQueryList.character2cm;
            paperArchive.character3cm = archiveQueryList.character3cm;
            paperArchive.character4cm = archiveQueryList.character4cm;
            paperArchive.character5cm = archiveQueryList.character5cm;
            //ViewData["characterVolumeCount"] = archiveQueryList.character2cm + archiveQueryList.character3cm + archiveQueryList.character4cm + archiveQueryList.character5cm;
            paperArchive.characterVolumeCount = archiveQueryList.character2cm + archiveQueryList.character3cm + archiveQueryList.character4cm + archiveQueryList.character5cm;

            paperArchive.drawing2cm = archiveQueryList.drawing2cm;
            paperArchive.drawing3cm = archiveQueryList.drawing3cm;
            paperArchive.drawing4cm = archiveQueryList.drawing4cm;
            paperArchive.drawing5cm = archiveQueryList.drawing5cm;
            //ViewData["drawingVolumeCount"] = archiveQueryList.drawing2cm + archiveQueryList.drawing3cm + archiveQueryList.drawing4cm + archiveQueryList.drawing5cm;
            paperArchive.drawingVolumeCount = archiveQueryList.drawing2cm + archiveQueryList.drawing3cm + archiveQueryList.drawing4cm + archiveQueryList.drawing5cm;
            //ViewData["originalVolumeCount"] = paperArchive.characterVolumeCount + paperArchive.drawingVolumeCount;
            //ViewData["originalInchCount"] = (archiveQueryList.character2cm + archiveQueryList.drawing2cm) * 2 + (archiveQueryList.character3cm + archiveQueryList.drawing3cm) * 3 + (archiveQueryList.character4cm + archiveQueryList.drawing4cm) * 4 + (archiveQueryList.character5cm + archiveQueryList.drawing5cm) * 5;
            paperArchive.originalVolumeCount = archiveQueryList.character2cm + archiveQueryList.character3cm + archiveQueryList.character4cm + archiveQueryList.character5cm + archiveQueryList.drawing2cm + archiveQueryList.drawing3cm + archiveQueryList.drawing4cm + archiveQueryList.drawing5cm;
            paperArchive.originalInchCount   = (archiveQueryList.character2cm + archiveQueryList.drawing2cm) * 2 + (archiveQueryList.character3cm + archiveQueryList.drawing3cm) * 3 + (archiveQueryList.character4cm + archiveQueryList.drawing4cm) * 4 + (archiveQueryList.character5cm + archiveQueryList.drawing5cm) * 5;
            paperArchive.copyInchCount       = archiveQueryList.copyInchCount;
            paperArchive.archivesCount       = (paperArchive.characterVolumeCount + paperArchive.drawingVolumeCount).ToString();

            if (action == "修改")
            {
                if (Convert.ToInt32(projectinfo.status) == 3 || Convert.ToInt32(projectinfo.status) == 5)
                {
                    ViewData["onlyread"] = false;
                }
                else
                {
                    ViewData["onlyread"] = true;
                }
                if (Convert.ToInt32(projectinfo.status) == 4)
                {
                    projectinfo.status = "9";
                }

                if (ModelState.IsValid)
                {
                    bb.Entry(paperArchive).State = EntityState.Modified;
                    bb.Entry(projectinfo).State  = EntityState.Modified;
                    bb.SaveChanges();
                    return(RedirectToAction("informationzhengli", "gxPaperSettle"));
                }
            }


            if (action == "返回")
            {
                return(RedirectToAction("StatisticalAndAnalysis"));
            }
            return(View());
        }