public ActionResult DeleteConfirmed(long id)
        {
            ArchivesDetail archivesDetail = db.ArchivesDetail.Find(id);

            db.ArchivesDetail.Remove(archivesDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "archivesNo,ID,archivesTitle,paperProjectSeqNo,paijiaNo,registrationNo,pageCount,volNo,mapsheetNo,microNo,storagePath,indexer,indexDate,checker,checkDate,typist,typerDate,archiveThickness,notearea,remarks,textMaterial,drawing,firstResponsible,responsibleOther,transferUnit,licenseNo,photoCount,bianzhiTime,kaigongTime,jungongTime,fazhaoTime,jgDate,developmentUnit,constructionUnit,designUnit,isImageExist,shizhengNo")] ArchivesDetail archivesDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(archivesDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.paperProjectSeqNo = new SelectList(db.PaperArchives, "paperProjectSeqNo", "firstResponsible", archivesDetail.paperProjectSeqNo);
     return(View(archivesDetail));
 }
        // GET: ArchivesDetails/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ArchivesDetail archivesDetail = db.ArchivesDetail.Find(id);

            if (archivesDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(archivesDetail));
        }
        // GET: ArchivesDetails/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ArchivesDetail archivesDetail = db.ArchivesDetail.Find(id);

            if (archivesDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.paperProjectSeqNo = new SelectList(db.PaperArchives, "paperProjectSeqNo", "firstResponsible", archivesDetail.paperProjectSeqNo);
            return(View(archivesDetail));
        }
        [ValidateAntiForgeryToken] //传入

        public ActionResult AddArchive(long paperProjectSeqNo, string action, string registrationNo, string archivesNo, string height, string volNo, string shizhenghao, string licenseNo, string mapsheetNo, string microNo, string securityID, string retentionPeriodNo, string structureTypeID, 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 heigh, string location, string remarks, string newLocation, string overground, string underground, string changeLog, string fazhaoTime, string jungongTime, string kaigongTime, string indexer, string indexDate, string checker, string checkDate, string Typist, string TyperDate)
        {
            if (action == "返回")
            {
                return(RedirectToAction("ArchiveMaga"));
            }
            var papaerarchive = from a in db.PaperArchives
                                where a.paperProjectSeqNo == paperProjectSeqNo
                                select a;
            PaperArchives paperArchives = papaerarchive.First();
            long          ID            = Convert.ToInt32(paperArchives.projectID);
            var           projectInfo   = from b in db.ProjectInfo
                                          where b.projectID == ID
                                          select b;
            ProjectInfo    projects = projectInfo.First();
            ArchivesDetail archive  = new ArchivesDetail();

            archive.registrationNo    = registrationNo;
            archive.archivesNo        = archivesNo;
            archive.paperProjectSeqNo = paperProjectSeqNo;
            if (archive.volNo.ToString().Trim() != "")
            {
                archive.volNo = Int32.Parse(archive.volNo.ToString().Trim());
            }
            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   = shizhenghao;       //市政档案号

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

            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();  //发照日期
            archive.jgDate      = DateTime.Parse(jgDate.Trim());
            string strlururiqi = TyperDate;           //录入日期

            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)
            {
                db.ArchivesDetail.Add(archive);


                db.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        = securityID.Trim();
                projects.retentionPeriodNo = retentionPeriodNo.Trim();
                projects.structureTypeID   = structureTypeID.Trim();
                projects.newLocation       = newLocation.Trim();
                if (ModelState.IsValid)
                {
                    db.Entry(projects).State = EntityState.Modified;

                    db.SaveChanges();
                }
            }
            if (paperArchives != null)
            {
                string jinguandata = paperArchives.jgDate.ToString();
                if (jinguandata != jgDate.Trim())
                {
                    paperArchives.jgDate = DateTime.Parse(jgDate.Trim());
                }
                paperArchives.buildingArea = Convert.ToDouble((buildingArea.Trim()));
                paperArchives.underground  = underground.Trim();
                paperArchives.overground   = overground.Trim();
                if (height.Trim() != "")
                {
                    paperArchives.height = Convert.ToDouble((height.Trim()));
                }
                paperArchives.luruTime          = TyperDate.Trim();
                paperArchives.projectStartDate  = kaigongTime.Trim();
                paperArchives.projectFinishDate = jungongTime.Trim();
                paperArchives.licenseNo         = licenseNo.Trim();
                paperArchives.licenseDate       = fazhaoTime.Trim();
                paperArchives.changeLog         = fazhaoTime.Trim();
                //paperArchives.changeLog = ddlChangeLog.Items[ddlChangeLog.SelectedIndex].Text;
                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 = shizhenghao;
                int    volCount   = 0;
                int.TryParse(paperArchives.archivesCount, out volCount);
                int vol = Convert.ToInt32(archive.volNo);

                if (vol == 1)
                {
                    paperArchives.shizhengNoStart = shizhengno;
                }
                if (vol == volCount)
                {
                    paperArchives.shizhengNoEnd = shizhengno;
                }
                if (ModelState.IsValid)
                {
                    db.Entry(paperArchives).State = EntityState.Modified;
                    db.SaveChanges();
                    return(JavaScript("保存成功"));
                }
            }


            return(View());
        }
示例#6
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());
            }
        }