public ActionResult Edit([Bind(Include = "cabinetNo,width,cengRangeA,cengRangeB,remainWidth,startPaijiaNo")] CabinetInfo cabinetinfo, string action) { if (action == "修改") { if (ModelState.IsValid) { db.Entry(cabinetinfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("InformationWarehouse")); } } if (action == "删除") { if (ModelState.IsValid) { db.Entry(cabinetinfo).State = EntityState.Deleted; db.SaveChanges(); return(RedirectToAction("InformationWarehouse")); } } if (action == "返回") { return(RedirectToAction("InformationWarehouse")); } return(View(cabinetinfo)); }
public ActionResult Create([Bind(Include = "juanneiSeqNo,fileNo,fileTitle,resUnit,pageNo,bianzhiDate,remarks,isNeibu")] LicenceFiles licenceFiles, int archiveID, string action) { licenceFiles.archiveID = archiveID;//将传进来的archiveID传给licenceFiles List <SelectListItem> listNeibu = new List <SelectListItem> { new SelectListItem { Text = "公开", Value = "0" }, new SelectListItem { Text = "内部", Value = "1" } }; ViewBag.isNeibu = new SelectList(listNeibu, "Value", "Text"); ViewBag.archiveID = archiveID; if (action == "保存") { if (ModelState.IsValid) { long max_ID = db.LicenceFiles.Max(d => d.ID); //当前录入记录的最大ID licenceFiles.ID = max_ID + 1; //新记录的ID+1,值唯一 //jsy前台传值到后台存储 licenceFiles.fileTitle = Request.Form["fileTitle"]; licenceFiles.resUnit = Request.Form["resUnit"]; //jsy db.LicenceFiles.Add(licenceFiles); db.SaveChanges(); //return Content("<script >alert('添加成功!');window.history.back();</script >"); return(Content("<script >alert('添加成功!');window.location.href='/LicenceFiles/Index?id1=1" + "&id=" + licenceFiles.ID + "&archiveID=" + archiveID + "';</script >")); //return RedirectToAction("Index", new { archiveID = archiveID,id1=1,id=0 }); } } if (action == "添加下一卷") { return(RedirectToAction("Index", new { archiveID = archiveID, id1 = 1, id = 0 })); } if (action == "删除词条") { int id = int.Parse(Request.Form["no"].Split('-').First()); WordTable wordtable = db.WordTable.Find(id); db.WordTable.Remove(wordtable); var list1 = db.WordTable.Where(ad => ad.newid > wordtable.newid).OrderBy(ad => ad.newid); foreach (var i in list1) { i.newid -= 1; ViewBag.fileTitle = Request.Form["fileTitle"]; ViewBag.resUnit = Request.Form["resUnit"]; db.Entry(i).State = EntityState.Modified; } db.SaveChanges(); } return(RedirectToAction("Index", new { archiveID = archiveID, id1 = 1, id = 0 })); }
public ActionResult DeletejuanNei(string id) { long fid = long.Parse(id); var file = from ad in db.fenleiFile where ad.id == fid select ad; fenleiFile fenleiFile = file.First(); string archivesNo = fenleiFile.archivesNo; db.Entry(fenleiFile).State = EntityState.Deleted; db.SaveChanges(); return(RedirectToAction("luru", new { archiveNo = archivesNo, id = 0, id2 = 1 })); }
public ActionResult Edit([Bind(Include = "ID,seqNo,classNo,archiveNo,registrationNo,paijiaNo,archiveTitle,bianzhiUnit,tuzhiYear,jgDate,tuzhiStatus,isBiaohu,measureUnit,tuzhiCount,securityID,retentionPeriodNo,neirongTiyao,storeLocation,transferUnit,bilichi,tufu,archiveCode,luruTime,isImageExist,isYD,coordinate")] TuzhiArchives tuzhiArchives, string action) { if (action == "保存修改") { if (tuzhiArchives.archiveTitle.Trim() == "") { return(Content("<script>alert('案卷提名不能为空!');window.history.back();")); } if (ModelState.IsValid) { if (tuzhiArchives.tuzhiCount == null) { tuzhiArchives.tuzhiCount = 0; } tuzhiArchives.isImageExist = "否"; db.Entry(tuzhiArchives).State = EntityState.Modified; db.SaveChanges(); //return Content("<script>alert('已修改成功!');window.location.href='../Index'</script>"); return(Content("<script>alert('已修改成功!');history.go(-1);</script>")); } } if (action == "返回") { return(RedirectToAction("Index")); } return(View(tuzhiArchives)); }
public ActionResult Edit([Bind(Include = "ID,regisNo,archiveNo,paijiaNo,bdzh,tufuNo,zdwh,archiveTitle,firstResponsible,otherResponsible,hbDate,hbLocation,hbAreaMu,hbAreaKM,jgDate,changeLog,securityID,retentionN,textPageCnt,drawingPageCnt,photoCnt,totolPageCnt,noteArea,zhutiCi,tiyaoXiang,zhuluDate,zlPerson,luruDate,luruPerson,seqNo,ArchiveThick,isImageExist,isYD")] zdArchive zdArchive, string action) { ViewBag.securityID = new SelectList(db.SecurityClassification, "securityID", "securityName", zdArchive.securityID); ViewBag.retentionN = new SelectList(db.RetentionPeriod, "retentionPeriodNo", "retentionPeriodName", zdArchive.retentionN); List <SelectListItem> list1 = new List <SelectListItem> { new SelectListItem { Text = "否", Value = "0" }, new SelectListItem { Text = "是", Value = "1" }, }; ViewBag.isYD = new SelectList(list1, "Value", "Text", zdArchive.isYD); List <SelectListItem> list = new List <SelectListItem> { new SelectListItem { Text = "请选择案卷厚度", Value = "0" }, new SelectListItem { Text = "1厘米", Value = "1" }, new SelectListItem { Text = "2厘米", Value = "2" }, new SelectListItem { Text = "3厘米", Value = "3" }, new SelectListItem { Text = "4厘米", Value = "4" }, new SelectListItem { Text = "5厘米", Value = "5" }, }; ViewBag.ArchiveThick = new SelectList(list, "Value", "Text", zdArchive.ArchiveThick); if (action == "保存修改") { if (ModelState.IsValid) { if (zdArchive.regisNo == null) { return(Content("<script>alert('总登记号不能为空!');window.history.back();</script>")); } zdArchive.isImageExist = "否"; db.Entry(zdArchive).State = EntityState.Modified; db.SaveChanges(); return(Content("<script>alert('已修改成功!');window.location.href='../Index'</script>")); } } if (action == "返回") { return(RedirectToAction("Index")); } return(View(zdArchive)); }
public ActionResult Edit([Bind(Include = "fileName,archivesNo,seqNo,fileNo,startPageNo,endPageNo,responsible,remarks,startDate,endDate,type,number,dengjihao,id")] FileInfo fileInfo) { if (ModelState.IsValid) { db.Entry(fileInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fileInfo)); }
public ActionResult Edit([Bind(Include = "contractNo,contractName,contractDesc,transferUnit,projectName,location,buildingArea,dateSigned,layerCount,planningStartDate,planningEndDate,scanningCopy,isReceiveArchive,textMaterial,drawing,partAaddress,partALegalRepresent,partAweituoAgent,partAcontactTel,partBadress,partBLegalRepresent,partBweituoAgent,partBcontactTel,constructUnit,constructArea")] ContractInfo contractInfo) { if (ModelState.IsValid) { db.Entry(contractInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contractInfo)); }
public ActionResult Edit([Bind(Include = "paperProjectSeqNo,projectNo,projectID,firstResponsible,responsibleOther,submitPerson,telphoneSubmitPerson,mobilephoneSubmitPerson,recipient,dateReceived,collator,collationRequirement,qjdyYear,qjdyNo,lqDate,mainCategoryID,subDictionaryID,minorDictionaryID,csyj,csyjPerson,csyjDate,fzryj,fzryjPerson,fzryjDate,zgyj,zgyjPerson,zgyjDate,characterVolumeCount,character2cm,character3cm,character4cm,character5cm,drawingVolumeCount,drawing2cm,drawing3cm,drawing4cm,drawing5cm,dateArchive,transferPerson,transferUnit,transferDate,passingDate,archiveCertificateNo,lqyjsDate,lqperson,transferContent,projectProfile,dateConstructed,archivesCount,InchCountDetail,originalVolumeCount,originalInchCount,originalMoneyAmount,copyInchCount,copyMoneyCount,totalMoney,startArchiveNo,endArchiveNo,startPaijiaNo,endPaijiaNo,startRegisNo,endRegisNo,licenseNo,licenseDate,jgDate,projectStartDate,projectFinishDate,changeLog,keyWords,notearea,remarks,buildingArea,height,underground,overground,structureTypeID,textMaterial,drawing,paijiaRange,prevClassNo,PhotoCount,bianhaoTime,luruTime,shizhengNoStart,shizhengNoEnd")] PaperArchives paperArchives) { if (ModelState.IsValid) { db.Entry(paperArchives).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.projectID = new SelectList(db.ProjectInfo, "projectID", "projectName", paperArchives.projectID); return(View(paperArchives)); }
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)); }
public ActionResult Edit(string seqNo, string searchNo, string unitName, string itemName, string chargeClassify, string chargeTime, string totalExpense, string theoryExpense, string a4total, string a4picPricePer, string a4pic, string a4picTotalFee, string a4word, string a4wordPricePer, string a4wordTotalFee, string a3total, string a3pic, string a3picPricePer, string a3picTotalFee, string a3word, string a3wordPricePer, string a3wordTotalFee, string a2total, string a2pic, string a2picPricePer, string a2picTotalFee, string a1total, string a1pic, string a1picPricePer, string a1picTotalFee, string a0total, string a0pic, string a0picPricePer, string a0picTotalFee, string a1totalLonger, string a1picLonge, string a1picPricePerLonger, string a1picTotalFeeLonger, string a0totalLonger, string a0picLonger, string a0picPricePerLonger, string a0picTotalFeeLonger, string fromDepartment, string @operator, string remarks, string chargeExtra, string buildingArea, string centiCnt, string whereTransfer, string action, long?id) { Charger charge = db.Charger.Find(id); if (action == "修改") { bool flag = false; string roles = User.Identity.Name.ToString(); if (roles == "打印") { flag = true; } if (flag == true) { if (chargeClassify.Trim() == "4") { var file = from a in db.FuyinFeeDetail where a.feeListNo == seqNo select a; if (file.Count() != 0) { FuyinFeeDetail filefuyin = file.First(); if (a4total == "" || a4total == null) { a4total = "0"; } int A4pageCnt = int.Parse(a4total.Trim()); filefuyin.A4PageCnt = A4pageCnt; if (a4pic == "" || a4pic == null) { a4total = "0"; } int A4picCnt = int.Parse(a4pic.Trim()); filefuyin.A4DrawingCnt = A4picCnt; if (a4picPricePer == "" || a4picPricePer == null) { a4total = "0"; } float A4picprice = float.Parse(a4picPricePer.Trim()); filefuyin.A4DrawingUnitPrice = A4picprice; if (a4picTotalFee == "" || a4picTotalFee == null) { a4total = "0"; } float A4pictotal = float.Parse(a4picTotalFee.Trim()); filefuyin.A4DrawingFee = A4pictotal; if (a4word == "" || a4word == null) { a4total = "0"; } int A4wordCnt = int.Parse(a4word.Trim()); filefuyin.A4TextCnt = A4wordCnt; if (a4wordPricePer == "" || a4wordPricePer == null) { a4total = "0"; } float A4wordprice = float.Parse(a4wordPricePer.Trim()); filefuyin.A3TextUnitPrice = A4wordprice; if (a4wordTotalFee == "" || a4wordTotalFee == null) { a4total = "0"; } float A4wordtotal = float.Parse(a4wordTotalFee.Trim()); filefuyin.A4TextFee = A4wordtotal; if (a3total == "" || a3total == null) { a4total = "0"; } int a3pagecn = int.Parse(a3total.Trim()); filefuyin.A3PageCnt = a3pagecn; if (a3pic == "" || a3pic == null) { a4total = "0"; } int A3piccnt = int.Parse(a3pic.Trim()); filefuyin.A3DrawingCnt = A3piccnt; if (a3picPricePer == "" || a3picPricePer == null) { a4total = "0"; } float A3picprice = float.Parse(a3picPricePer.Trim()); filefuyin.A3DrawingUnitPrice = A3picprice; if (a3picTotalFee == "" || a3picTotalFee == null) { a4total = "0"; } float A3pictotal = float.Parse(a3picTotalFee.Trim()); filefuyin.A3DrawingFee = A3pictotal; if (a3word == "" || a3word == null) { a4total = "0"; } int A3wordcnt = int.Parse(a3word.Trim()); filefuyin.A3TextCnt = A3wordcnt; if (a3wordPricePer == "" || a3wordPricePer == null) { a4total = "0"; } float A3wordprice = float.Parse(a3wordPricePer.Trim()); filefuyin.A3TextUnitPrice = A3wordprice; if (a3wordTotalFee == "" || a3wordTotalFee == null) { a4total = "0"; } float A3wordtotal = float.Parse(a3wordTotalFee.Trim()); filefuyin.A3TextFee = A3wordtotal; if (a2total == "" || a2total == null) { a4total = "0"; } int A2pagecn = int.Parse(a2total.Trim()); filefuyin.A4PageCnt = A4pageCnt; if (a2pic == "" || a2pic == null) { a4total = "0"; } int A2pageCnt = int.Parse(a2pic.Trim()); filefuyin.A2PageCnt = A2pageCnt; if (a2picPricePer == "" || a2picPricePer == null) { a4total = "0"; } float A2picprice = float.Parse(a2picPricePer.Trim()); filefuyin.A2DrawingUnitPrice = A2picprice; if (a2picTotalFee == "" || a2picTotalFee == null) { a4total = "0"; } float A2pictoyal = float.Parse(a2picTotalFee.Trim()); filefuyin.A2DrawingFee = A2pictoyal; if (a1total == "" || a1total == null) { a4total = "0"; } int A1pageCnt = int.Parse(a1total.Trim()); filefuyin.A1PageCnt = A1pageCnt; if (a1pic == "" || a1pic == null) { a4total = "0"; } int A1picCnt = int.Parse(a1pic.Trim()); filefuyin.A1DrawingCnt = A1picCnt; if (a1picPricePer == "" || a1picPricePer == null) { a4total = "0"; } float A1picprice = float.Parse(a1picPricePer.Trim()); filefuyin.A1DrawingUnitPrice = A1picprice; if (a1picTotalFee == "" || a1picTotalFee == null) { a4total = "0"; } float A1pictotal = float.Parse(a1picTotalFee.Trim()); filefuyin.A1DrawingFee = A1pictotal; if (a0total == "" || a0total == null) { a4total = "0"; } int A0pageCnt = int.Parse(a0total.Trim()); filefuyin.A0PageCnt = A0pageCnt; if (a0pic == "" || a0pic == null) { a4total = "0"; } int A0picCnt = int.Parse(a0pic.Trim()); filefuyin.A0DrawingCnt = A0picCnt; if (a0picPricePer == "" || a0picPricePer == null) { a4total = "0"; } float A0picprice = float.Parse(a0picPricePer.Trim()); filefuyin.A0DrawingUnitPrice = A0picprice; if (a0picTotalFee == "" || a0picTotalFee == null) { a4total = "0"; } float A0total = float.Parse(a0picTotalFee.Trim()); filefuyin.A0DrawingFee = A0total; if (a1totalLonger == "" || a1totalLonger == null) { a4total = "0"; } int A1addpageCnt = int.Parse(a1totalLonger.Trim()); filefuyin.A1AddDrawingCnt = A1addpageCnt; if (a1picLonge == "" || a1picLonge == null) { a4total = "0"; } int A1addpiccnt = int.Parse(a1picLonge.Trim()); filefuyin.A1AddDrawingCnt = A1addpiccnt; if (a1picPricePerLonger == "" || a1picPricePerLonger == null) { a4total = "0"; } float A1addpicprice = float.Parse(a1picPricePerLonger.Trim()); filefuyin.A1AddDrawingUnitPrice = A1addpicprice; if (a1picTotalFeeLonger == "" || a1picTotalFeeLonger == null) { a4total = "0"; } float A1addtotal = float.Parse(a1picTotalFeeLonger); filefuyin.A1AddDrawingFee = A1addtotal; if (a0totalLonger == "" || a0totalLonger == null) { a4total = "0"; } int a0addpagecnt = int.Parse(a0totalLonger.Trim()); filefuyin.A0AddPageCnt = a0addpagecnt; if (a0picLonger == "" || a0picLonger == null) { a4total = "0"; } int A0addpiccnt = int.Parse(a0picLonger.Trim()); filefuyin.A0AddDrawingCnt = A0addpiccnt; if (a0picPricePerLonger == "" || a0picPricePerLonger == null) { a4total = "0"; } float a0addprice = float.Parse(a0picPricePerLonger.Trim()); filefuyin.A0AddDrawingFee = a0addprice; if (a0picTotalFeeLonger == "" || a0picTotalFeeLonger == null) { a4total = "0"; } float A0addtotal = float.Parse(a0picTotalFeeLonger.Trim()); filefuyin.A0AddDrawingFee = A0addtotal; DateTime chargetime = DateTime.Today; filefuyin.dateCharged = chargetime; filefuyin.unitCharged = @operator; if (theoryExpense.Trim() != "" || theoryExpense.Trim() == null) { filefuyin.theoryFee = double.Parse(theoryExpense.Trim()); } filefuyin.searchNo = seqNo.Trim(); if (totalExpense.Trim() != "") { filefuyin.totalFee = double.Parse(totalExpense.Trim()); } db.Entry(filefuyin).State = EntityState.Modified; } } } if (charge != null) { charge.unitName = unitName; charge.itemName = itemName; bool flag1 = false; var type = from a in db.ChargeType where a.value.ToString() == chargeClassify select a; if (type.Count() != 0) { flag1 = true; charge.chargeClassify = Convert.ToInt32(chargeClassify); } if (flag1 == false) { //将新的收费项添加到列表中区 var type1 = from b in db.ChargeType orderby b.value descending select b; ChargeType type3 = new ChargeType(); type3.value = type1.First().value + 1; type3.text = chargeClassify; db.ChargeType.Add(type3); } charge.@operator = @operator; charge.seqNo = seqNo; charge.remarks = remarks; DateTime time = Convert.ToDateTime(chargeTime); charge.chargeTime = time; if (totalExpense.Trim() != "") { charge.totalExpense = decimal.Parse(totalExpense.Trim()); } else { return(Content("<script >alert('实际收费不能为空!');window.history.back();</script >")); } if (theoryExpense.Trim() != "") { charge.theoryExpense = decimal.Parse(theoryExpense.Trim()); } else { charge.theoryExpense = charge.totalExpense; } charge.fromDepartment = fromDepartment; charge.whereTransfer = Int32.Parse(whereTransfer); charge.chargeDetail = "收取" + charge.unitName + "," + charge.itemName + ",共" + totalExpense.Trim() + "元"; charge.isBack = false; if (charge.fromDepartment.Trim() == "1")//来自业务科 { if (chargeExtra == "1") { charge.chargeExtra = "1"; } if (chargeExtra == "2") { charge.chargeExtra = "2"; if (centiCnt.Trim() == "") { return(Content("<script >alert('公分数不能为空!');window.history.back();</script >")); } charge.centiCnt = float.Parse(centiCnt.Trim()); } if (buildingArea.Trim() == "") { return(Content("<script >alert('建筑面积不能为空!');window.history.back();</script >")); } charge.searchNo = Int32.Parse(searchNo); charge.buildingArea = float.Parse(buildingArea.Trim()); } try { db.Entry(charge).State = EntityState.Modified; db.SaveChanges(); ViewData["xiugai"] = true; return(Content("<script >alert('收费修改成功');window.history.back();</script >")); } catch (System.Exception ex) { Response.Write("<script language=\'javascript\'>alert('" + ex.Message + "');</script>"); } } } if (action == "返回") //jsy修改 { if (charge.centiCnt != -1) { return(RedirectToAction("Create", "ProjectCharge")); } else { return(RedirectToAction("OtherFeiYongChaXun", "Charge")); } } //jsy修改 return(View()); }
[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()); }
public ActionResult SeeSettle([Bind(Include = "InchCountDetail,characterVolumeCount,character1cm,character2cm,character3cm,character4cm,character5cm,originalVolumeCount,originalInchCount,drawingVolumeCount,drawing1cm,drawing2cm,drawing3cm,drawing4cm,drawing5cm,copyInchCount")] vw_archiveQueryList archiveQueryList, string action, long?id, string id2) { var paper = from ad in db.PaperArchives where (ad.projectID == id) select ad; PaperArchives paperArchive = paper.First(); var project = from ac in db.ProjectInfo where (ac.projectID == id) select ac; ProjectInfo projectinfo = project.First(); paperArchive.InchCountDetail = archiveQueryList.InchCountDetail; paperArchive.character1cm = archiveQueryList.character1cm; 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.character1cm + archiveQueryList.character2cm + archiveQueryList.character3cm + archiveQueryList.character4cm + archiveQueryList.character5cm; paperArchive.drawing1cm = archiveQueryList.drawing1cm; 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.drawing1cm + 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) { db.Entry(paperArchive).State = EntityState.Modified; db.Entry(projectinfo).State = EntityState.Modified; db.SaveChanges(); if (id2 == "1") { return(Content("<script >alert('修改成功');window.location.href='../StatisticalAndRetrieval/StatisticalAndAnalysis';</script >")); } if (id2 == "2") { return(Content("<script >alert('修改成功');window.location.href='../StatisticalAndRetrieval/AllArchives';</script >")); } } } if (action == "返回") { if (id2 == "2") { return(RedirectToAction("AllArchives")); } else { return(RedirectToAction("StatisticalAndAnalysis")); } } return(View()); }
public ActionResult HeJuFeiYongEdit(string action, [Bind(Include = "ID,twoCentiCnt,thrCentiCnt,fourCentiCnt,fiveCentiCnt,coverCnt,catalogueCnt,proformaCnt,DepartName,submitDate,submitPerson,archiveBoxFee,archiveCataLogFee,singleBoxFee,singleCatalogFee,seqNo")] ArchivesContainer archivesContainer, Charger charger) { long id = long.Parse(Request.Form["ID"]); var charge = from ad in ab.Charger where ad.searchNo == id select ad; var charge1 = charge.First(); ViewBag.total = charge1.totalExpense; ViewBag.Selected = new SelectList(ab.DepartmentCode, "value", "Text", charge1.fromDepartment); List <SelectListItem> list3 = new List <SelectListItem> { new SelectListItem { Text = "转向财务科", Value = "1" }, new SelectListItem { Text = "转向复印室", Value = "0" }, }; ViewBag.Selected1 = new SelectList(list3, "Value", "Text", charge1.whereTransfer); //Charger charger = new Charger(); long max_chargerID = ab.Charger.Max(d => d.ID); long newchargerID = max_chargerID + 1; string totle = Request.Form["total"]; string zhuanxiang = Request.Form["Selected1"]; string data = Request.Form["submitDate"]; string no = data.Replace("-", ""); if (action == "生成最大收费编号") { if (data.Contains("-")) { if (ModelState.IsValid) { var list1 = from ad in db.ArchivesContainer where ad.seqNo.Contains(no) orderby ad.ID descending select ad; if (list1.Count() != 0) { var list = list1.First(); long max_seqno = long.Parse(list.seqNo); long seqno = max_seqno + 1; archivesContainer.seqNo = seqno.ToString(); ViewBag.seqNo = archivesContainer.seqNo; ViewBag.totle = charge1.totalExpense; ViewBag.twoCentiCnt = archivesContainer.twoCentiCnt; ViewBag.thrCentiCnt = archivesContainer.thrCentiCnt; ViewBag.fourCentiCnt = archivesContainer.fourCentiCnt; ViewBag.fiveCentiCnt = archivesContainer.fiveCentiCnt; ViewBag.coverCnt = archivesContainer.coverCnt; ViewBag.catalogueCnt = archivesContainer.catalogueCnt; ViewBag.proformaCnt = archivesContainer.proformaCnt; } else { archivesContainer.seqNo = no + "001"; ViewBag.seqNo = archivesContainer.seqNo; ViewBag.totle = charge1.totalExpense; ViewBag.twoCentiCnt = archivesContainer.twoCentiCnt; ViewBag.thrCentiCnt = archivesContainer.thrCentiCnt; ViewBag.fourCentiCnt = archivesContainer.fourCentiCnt; ViewBag.fiveCentiCnt = archivesContainer.fiveCentiCnt; ViewBag.coverCnt = archivesContainer.coverCnt; ViewBag.catalogueCnt = archivesContainer.catalogueCnt; ViewBag.proformaCnt = archivesContainer.proformaCnt; } } } else { Response.Write("<script >alert('请选择提交时间');window.history.back();</script >"); } } if (action == "保存") { if (ModelState.IsValid) { string NO = Request.Form["seqNo"]; archivesContainer.seqNo = NO; string person = Request.Form["Selected"]; archivesContainer.submitPerson = person; db.Entry(archivesContainer).State = EntityState.Modified; db.SaveChanges(); charge1.searchNo = archivesContainer.ID; charge1.totalExpense = decimal.Parse(totle); charge1.unitName = archivesContainer.DepartName; charge1.chargeTime = archivesContainer.submitDate; charge1.seqNo = archivesContainer.seqNo; charge1.theoryExpense = decimal.Parse(totle); charge1.whereTransfer = int.Parse(zhuanxiang); ab.Entry(charge1).State = EntityState.Modified; ab.SaveChanges(); return(RedirectToAction("Index")); } } return(View(archivesContainer)); }
[ValidateAntiForgeryToken] //传入 public ActionResult LingquYiJianshu(long projectID, string workUnit, string lingquPerson, string contractTel, string fafangPerson, DateTime?lingquDate, string isLingquYijiaoshu, string action) { if (action == "返回") { return(RedirectToAction("MeterialsSend")); } var project = from b in db.ProjectInfo where b.projectID == projectID select b; ProjectInfo d = project.First(); if (action == "确定") { LingquInterchangeForm lingqu = new LingquInterchangeForm(); lingqu.workUnit = workUnit; lingqu.lingquPerson = lingquPerson; lingqu.contractTel = contractTel; lingqu.fafangPerson = fafangPerson; string str = Convert.ToDateTime(lingquDate).ToString("yyyy-MM-dd"); lingqu.lingquDate = DateTime.ParseExact(str.Trim(), "yyyy-MM-dd", null).Date; lingqu.projectID = projectID; var maxid = db.LingquInterchangeForm.Max(a => a.ID); lingqu.ID = maxid + 1; d.isLingquYijiaoshu = bool.Parse(isLingquYijiaoshu); db.LingquInterchangeForm.Add(lingqu); db.Entry(d).State = EntityState.Modified; db.SaveChanges(); return(Content("<script >alert('确认成功');window.location.href='../LaterMaterials/MeterialsSend';</script >")); } if (action == "更新") { var vwArchiveList = from a in db.LingquInterchangeForm where a.projectID == projectID select a; if (vwArchiveList.Count() == 0) { return(Content("<script >alert('请先领取');window.history.back();</script >")); } LingquInterchangeForm c = vwArchiveList.First(); c.workUnit = workUnit.Trim(); c.lingquPerson = lingquPerson.Trim(); c.contractTel = contractTel.Trim(); c.fafangPerson = fafangPerson.Trim(); string str = Convert.ToDateTime(lingquDate).ToString("yyyy-MM-dd"); c.lingquDate = DateTime.ParseExact(str.Trim(), "yyyy-MM-dd", null).Date; if (isLingquYijiaoshu.ToString() == "true") { d.isLingquYijiaoshu = true; } else { d.isLingquYijiaoshu = false; } db.Entry(c).State = EntityState.Modified; db.Entry(d).State = EntityState.Modified; db.SaveChanges(); return(Content("<script >alert('修改成功');window.history.back();</script >")); } return(View()); }