public ActionResult SaveJobDetails(HardCard model) { string errors = String.Empty; try { if (model.HardCardId == 0) { model.HardCardId = (Convert.ToInt32(Session["HardCardId"])); } if (ModelState.IsValid) { var result = Convert.ToInt32(HardCardDal.saveJobDetails(model)); if (result > 0) { model.HardCardId = result; LookUpHardCardCombos(model); return(View("create", model)); } } else { errors = GetModelError(errors); } LookUpHardCardCombos(model); return(View("create", model)); } catch (Exception ex) { ModelState.AddModelError(String.Empty, ex.Message + BusinessConstants.contactAdmin); return(RedirectToAction("error", ex));; } }
public ActionResult Create(string PRJID = "", string BIDID = "") { int BIDId = 0; int projectHeaderID = 0; var model = new HardCard(); if (!string.IsNullOrWhiteSpace(PRJID) && Int32.TryParse(PRJID, out projectHeaderID)) { Session["PRJID"] = PRJID; model.ProjectHeaderId = projectHeaderID; } if (!string.IsNullOrWhiteSpace(BIDID) && Int32.TryParse(BIDID, out BIDId)) { Session["BIDID"] = BIDId; model.BidItemHeaderid = BIDId; } if (Session["BIDID"] != null && Session["BIDID"] != null) { LookUpHardCardCombos(model); if (model.ProjectHeaderId == 0 || model.BidItemHeaderid == 0) { return(View("create", model)); } var hardCardItem = HardCardDal.getHardCardItem(PRJID, BIDID); if (hardCardItem.Rows.Count == 1) { model.HardCardId = Convert.ToInt32(hardCardItem.Rows[0]["HardCardID"]); HardCardDal.getHardCardDetails(model); } return(View("create", model)); } return(RedirectToAction("error")); }
public FileStreamResult printHardCardDetails(string hid) { string title = string.Empty; title = ""; var model = new HardCard(); model.HardCardId = Convert.ToInt32(hid); HardCardDal.getHardCardDetails(model); HardCardDal.getHardCardLookUpList(model); // Set up the document and the MS to write it to and create the PDF writer instance MemoryStream ms = new MemoryStream(); Document document = new Document(PageSize.A4, 15, 10, 15, 35); PdfWriter writer = PdfWriter.GetInstance(document, ms); writer.PageEvent = new PDFReportEventHelper(title); // Open the PDF document document.Open(); document.Add(PDFUtil.HeaderSection("Job Card")); #region Job Info var jobInfo = PDFUtil.createTableWithHeader("Job Information", new float[] { 2, 2, 2, 2 }); jobInfo.AddCell(PDFUtil.CreateCell("Estimator", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.EstimatorsName, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Job Number", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.Atlas_Job_Number, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Est.Phone #", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(AppUtil.formatPhoneNumber(model.JobInformationDetails.ContractPhoneNumber), PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("BI Number", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.BidItemHeaderId, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Job Name", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.JobName, PDFUtil.spanNormalBlack, colSpan: 3)); jobInfo.AddCell(PDFUtil.CreateCell("Job Address", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.JobAddress, PDFUtil.spanNormalBlack, colSpan: 3)); jobInfo.AddCell(PDFUtil.CreateCell("Job City", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.JobCity, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Job State", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.JobState, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Job Contact", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.JobContact, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Call In Route", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(model.JobInformationDetails.ListJobInfoResponse. FirstOrDefault(i => i.ResponseId.ToString() == model.JobInformationDetails.CallInRoute)?.Response, PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Contact Phone", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(AppUtil.formatPhoneNumber(model.JobInformationDetails.JobPhone), PDFUtil.spanNormalBlack)); jobInfo.AddCell(PDFUtil.CreateCell("Contact Cell", PDFUtil.font_body_bold, 2, false)); jobInfo.AddCell(PDFUtil.CreateCell(AppUtil.formatPhoneNumber(model.JobInformationDetails.JobCell), PDFUtil.spanNormalBlack)); document.Add(jobInfo); #endregion #region ContractorInfo var contractInfo = PDFUtil.createTableWithHeader("Contractor Information", new float[] { 2, 2, 2, 2 }); contractInfo.AddCell(PDFUtil.CreateCell("Contractor Name", PDFUtil.font_body_bold, 2, false)); contractInfo.AddCell(PDFUtil.CreateCell(model.ContractInformationDetails.ContractorName, PDFUtil.spanNormalBlack, colSpan: 3)); contractInfo.AddCell(PDFUtil.CreateCell("Primary Contact Name", PDFUtil.font_body_bold, 2, false)); contractInfo.AddCell(PDFUtil.CreateCell(model.ContractInformationDetails.PrimaryContact, PDFUtil.spanNormalBlack)); contractInfo.AddCell(PDFUtil.CreateCell("Phone", PDFUtil.font_body_bold, 2, false)); contractInfo.AddCell(PDFUtil.CreateCell(AppUtil.formatPhoneNumber(model.ContractInformationDetails.PrimaryPhone), PDFUtil.spanNormalBlack)); contractInfo.AddCell(PDFUtil.CreateCell("Fence Type", PDFUtil.font_body_bold, 2, false)); contractInfo.AddCell(PDFUtil.CreateCell(model.ContractInformationDetails.ListFenceTypes. First(i => i.FenceTypeId.ToString() == model.ContractInformationDetails.FenceType).FenceTypeName, PDFUtil.spanNormalBlack, colSpan: 3)); contractInfo.AddCell(PDFUtil.CreateCell("Special Notes", PDFUtil.font_body_bold, 2, false)); contractInfo.AddCell(PDFUtil.CreateCell(model.ContractInformationDetails.SplNotes, PDFUtil.spanNormalBlack)); contractInfo.AddCell(PDFUtil.CreateCell("Directions", PDFUtil.font_body_bold, 2, false)); contractInfo.AddCell(PDFUtil.CreateCell(model.ContractInformationDetails.Directions, PDFUtil.spanNormalBlack)); document.Add(contractInfo); #endregion #region Installation var installDetails = PDFUtil.createTableWithHeader("Installation", new float[] { 2, 2, 2, 2, 2, 2 }); installDetails.AddCell(PDFUtil.CreateCell("Pre Make Gates", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId.ToString() == model.InstallationDetails.PremakeGate.ToString()).Response, PDFUtil.spanNormalBlack, colSpan: 5)); installDetails.AddCell(PDFUtil.CreateCell("CBYD", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId.ToString() == model.InstallationDetails.CBYD.ToString()).Response, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("CBYD Date", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.CBYDDate, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("CBYD Number", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.CBYDNumber, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Start Date", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.StartDate, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Finish Date", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.FinishDate, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Hard Date", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. FirstOrDefault(i => i.ResponseId.ToString() == model.InstallationDetails.HardDate)?.Response, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Gate Description", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.GateDescription1, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Gate Installation", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListGateInstallation. FirstOrDefault(i => i.GateInstallationID.ToString() == model.InstallationDetails.GateInstallationID1)?.Description, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Gate Description", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.GateDescription2, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Gate Installation", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListGateInstallation. FirstOrDefault(i => i.GateInstallationID.ToString() == model.InstallationDetails.GateInstallationID2)?.Description, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Gate Description", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.GateDescription3, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Gate Installation", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListGateInstallation. FirstOrDefault(i => i.GateInstallationID.ToString() == model.InstallationDetails.GateInstallationID3)?.Description, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Gate Description", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.GateDescription4, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Gate Installation", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListGateInstallation. FirstOrDefault(i => i.GateInstallationID.ToString() == model.InstallationDetails.GateInstallationID4)?.Description, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Gate Description", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.GateDescription5, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Gate Installation", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListGateInstallation. FirstOrDefault(i => i.GateInstallationID.ToString() == model.InstallationDetails.GateInstallationID5)?.Description, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Equipment Required", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId.ToString() == model.InstallationDetails.EquipmentRequired).Response, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Dig Type", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListDigType. First(i => i.DigTypeId == model.InstallationDetails.DigTypeID).DigType, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Water Available", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId.ToString() == model.InstallationDetails.WaterAvailible.ToString()).Response, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Electricity Available", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId == model.InstallationDetails.ElectricityAvailible).Response, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Measure By Installer", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId.ToString() == model.InstallationDetails.MeasureByInstaller.ToString()).Response, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Leave Samples By Installer", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.ListInstallationResponses. First(i => i.ResponseId == model.InstallationDetails.LeaveSamplesByInstaller).Response, PDFUtil.spanNormalBlack, colSpan: 3)); installDetails.AddCell(PDFUtil.CreateCell("Budgeted Install Days", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.BudgetedInstallDays, PDFUtil.spanNormalBlack)); installDetails.AddCell(PDFUtil.CreateCell("Scope", PDFUtil.font_body_bold, 2, false)); installDetails.AddCell(PDFUtil.CreateCell(model.InstallationDetails.Scope, PDFUtil.spanNormalBlack, colSpan: 3)); document.Add(installDetails); #endregion document.NewPage(); #region BuildChecklist var buildList = PDFUtil.createTableWithHeader("Build Checklist", new float[] { 2, 2, 2, 2, 3, 2 }); buildList.AddCell(PDFUtil.CreateCell("Pool Code", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId.ToString() == model.BuildChecklistDetails.PoolCode.ToString()).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Dowelled", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.Dowelled).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Safety Officer Onsite", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.SafetyOfficerOnsite).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Build For Rack", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId.ToString() == model.BuildChecklistDetails.BuildForRack.ToString()).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Morticed", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.Morticed).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Saftey Meeting/Orientation Onsite", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.SafteyMeetingOrintationOnsiteReq).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Stepping Temp", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId.ToString() == model.BuildChecklistDetails.SteppingTemp.ToString()).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Nail On", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.NailOn).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Saftey Inspection Before Job Starts", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.SafteyInspectionReqBeforeJobStarts).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Fence Direction", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListFenceDirection. First(i => i.FenceDirectionID.ToString() == model.BuildChecklistDetails.FenceDirectionID.ToString()).Description, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Single Nailed", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.SingleNailed).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("PPE Required", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.PPERequired).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Fence Install", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListFenceInstall. First(i => i.FenceInstallID.ToString() == model.BuildChecklistDetails.FenceInstallID.ToString()).Description, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Build Full Sections", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.BuildFullSections).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Equipment Operator Certs", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.EquipmentOperatorCertsReq).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Trim In Field", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.TrimInField).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Stain", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.Stain).Response, PDFUtil.spanNormalBlack, colSpan: 3)); buildList.AddCell(PDFUtil.CreateCell("Post Pins", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListBuildResponses. First(i => i.ResponseId == model.BuildChecklistDetails.PostPins).Response, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Stain Color", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.StainColor, PDFUtil.spanNormalBlack, colSpan: 3)); buildList.AddCell(PDFUtil.CreateCell("Tear Out Type", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.ListTearOutType. First(i => i.TearOutTypeID == model.BuildChecklistDetails.TearOutTypeID).Description, PDFUtil.spanNormalBlack)); buildList.AddCell(PDFUtil.CreateCell("Stain Brand", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.StainBrand, PDFUtil.spanNormalBlack, colSpan: 3)); buildList.AddCell(PDFUtil.CreateCell("Other Hazards", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.OtherHazards, PDFUtil.spanNormalBlack, colSpan: 2)); buildList.AddCell(PDFUtil.CreateCell("Notes", PDFUtil.font_body_bold, 2, false)); buildList.AddCell(PDFUtil.CreateCell(model.BuildChecklistDetails.Notes, PDFUtil.spanNormalBlack, colSpan: 3)); document.Add(buildList); #endregion document.Close(); byte[] file = ms.ToArray(); MemoryStream output = new MemoryStream(); output.Write(file, 0, file.Length); output.Position = 0; HttpContext.Response.AddHeader("content-disposition", "inline; filename=HardCard" + hid + ".pdf"); return(File(output, "application/pdf")); }
private void LookUpHardCardCombos(HardCard model) { if (model.JobInformationDetails == null) { model.ProjectHeaderId = (Convert.ToInt32(Session["PRJID"])); model.BidItemHeaderid = (Convert.ToInt32(Session["BIDID"])); } HardCardDal.getHardCardLookUpList(model); IEnumerable <SelectListItem> ListJobInfoResponse = model.JobInformationDetails?.ListJobInfoResponse?.Select(c => new SelectListItem { Value = Convert.ToString(c.ResponseId), Text = c.Response }); ViewBag.ListJobInfoResponse = ListJobInfoResponse; IEnumerable <SelectListItem> ListFenceTypes = model.ContractInformationDetails?.ListFenceTypes?.Select(c => new SelectListItem { Value = Convert.ToString(c.FenceTypeId), Text = c.FenceTypeName }); ViewBag.ListFenceTypes = ListFenceTypes; IEnumerable <SelectListItem> ListInstallationResponses = model.InstallationDetails?.ListInstallationResponses?.Select(c => new SelectListItem { Value = Convert.ToString(c.ResponseId), Text = c.Response }); ViewBag.ListInstallationResponses = ListInstallationResponses; IEnumerable <SelectListItem> ListGateInstallation = model.InstallationDetails?.ListGateInstallation?.Select(c => new SelectListItem { Value = Convert.ToString(c.GateInstallationID), Text = c.Description }); ViewBag.ListGateInstallation = ListGateInstallation; IEnumerable <SelectListItem> ListDigType = model.InstallationDetails?.ListDigType?.Select(c => new SelectListItem { Value = Convert.ToString(c.DigTypeId), Text = c.DigType }); ViewBag.ListDigType = ListDigType; IEnumerable <SelectListItem> ListBuildResponses = model.BuildChecklistDetails.ListBuildResponses?.Select(c => new SelectListItem { Value = Convert.ToString(c.ResponseId), Text = c.Response }); ViewBag.ListBuildResponses = ListBuildResponses; IEnumerable <SelectListItem> ListFenceDirection = model.BuildChecklistDetails.ListFenceDirection?.Select(c => new SelectListItem { Value = Convert.ToString(c.FenceDirectionID), Text = c.Description }); ViewBag.ListFenceDirection = ListFenceDirection; IEnumerable <SelectListItem> ListFenceInstall = model.BuildChecklistDetails.ListFenceInstall?.Select(c => new SelectListItem { Value = Convert.ToString(c.FenceInstallID), Text = c.Description }); ViewBag.ListFenceInstall = ListFenceInstall; IEnumerable <SelectListItem> ListTearOutType = model.BuildChecklistDetails.ListTearOutType?.Select(c => new SelectListItem { Value = Convert.ToString(c.TearOutTypeID), Text = c.Description }); ViewBag.ListTearOutType = ListTearOutType; }
public static HardCard getHardCardLookUpList(HardCard objHardCard) { try { var resultSet = SqlHelper.ExecuteDataset(_myConnection, CommandType.StoredProcedure, "spATL_PRJ_HardCard_LkUp", new SqlParameter("@PRJID", objHardCard.ProjectHeaderId), new SqlParameter("@BIDID", objHardCard.BidItemHeaderid)); if (objHardCard.JobInformationDetails == null) { objHardCard.JobInformationDetails = new JobInformation(); } if (objHardCard.ContractInformationDetails == null) { objHardCard.ContractInformationDetails = new ContractorInformation(); } if (objHardCard.InstallationDetails == null) { objHardCard.InstallationDetails = new Installation(); } if (objHardCard.BuildChecklistDetails == null) { objHardCard.BuildChecklistDetails = new BuildChecklist(); } if (resultSet.Tables[0].Rows.Count > 0) { var item = resultSet.Tables[0].Rows[0]; objHardCard.ProjectHeaderId = Convert.ToInt32(item["ProjectHeaderId"]); objHardCard.JobInformationDetails.EstimatorsName = Convert.ToString(item["EstimatorsName"]); objHardCard.JobInformationDetails.Atlas_Job_Number = Convert.ToString(item["Atlas_Job_Number"]); objHardCard.JobInformationDetails.ContractPhoneNumber = Convert.ToString(item["ContractPhoneNumber"]); objHardCard.JobInformationDetails.JobName = Convert.ToString(item["JobName"]); objHardCard.JobInformationDetails.JobAddress = Convert.ToString(item["JobAddress"]); objHardCard.JobInformationDetails.JobCity = Convert.ToString(item["JobCity"]); objHardCard.JobInformationDetails.JobState = Convert.ToString(item["JobState"]); objHardCard.JobInformationDetails.JobZip = Convert.ToString(item["JobZip"]); objHardCard.JobInformationDetails.JobContact = Convert.ToString(item["JobContact"]); objHardCard.JobInformationDetails.JobPhone = Convert.ToString(item["JobPhone"]); objHardCard.ContractInformationDetails.ContractorName = Convert.ToString(item["ContName"]); objHardCard.ContractInformationDetails.PrimaryContact = Convert.ToString(item["ContContact"]); objHardCard.ContractInformationDetails.PrimaryPhone = Convert.ToString(item["ContMobile"]); } objHardCard.JobInformationDetails.ListJobInfoResponse = new List <DOC10_Responses>(); objHardCard.JobInformationDetails.ListJobInfoResponse = getResponseList(resultSet); if (resultSet.Tables[1].Rows.Count > 0) { var item = resultSet.Tables[1].Rows[0]; objHardCard.JobInformationDetails.BidItemHeaderId = Convert.ToInt32(item["BidItemHeaderId"]); objHardCard.ContractInformationDetails.FenceType = Convert.ToString(item["FenceTypeId"]); } if (resultSet.Tables[0].Rows.Count == 0 || resultSet.Tables[1].Rows.Count == 0) { objHardCard.BidItemHeaderid = 0; objHardCard.ProjectHeaderId = 0; } objHardCard.ContractInformationDetails.ListFenceTypes = new List <SYS07_FenceTypes>(); objHardCard.ContractInformationDetails.ListFenceTypes = getFenceTypes(resultSet); objHardCard.InstallationDetails.ListInstallationResponses = new List <DOC10_Responses>(); objHardCard.InstallationDetails.ListInstallationResponses = getResponseList(resultSet); objHardCard.InstallationDetails.ListDigType = getDigTypes(resultSet); objHardCard.InstallationDetails.ListGateInstallation = new List <DOC05_GateInstallation>(); objHardCard.InstallationDetails.ListGateInstallation = getGateInstallation(resultSet); objHardCard.BuildChecklistDetails.ListBuildResponses = new List <DOC10_Responses>(); objHardCard.BuildChecklistDetails.ListBuildResponses = getResponseList(resultSet); objHardCard.BuildChecklistDetails.ListFenceDirection = new List <DOC04_FenceDirection>(); objHardCard.BuildChecklistDetails.ListFenceDirection = getFenceDirections(resultSet); objHardCard.BuildChecklistDetails.ListFenceInstall = new List <DOC03_FenceInstall>(); objHardCard.BuildChecklistDetails.ListFenceInstall = getFenceInstalls(resultSet); objHardCard.BuildChecklistDetails.ListTearOutType = new List <DOC06_TearOutTypes>(); objHardCard.BuildChecklistDetails.ListTearOutType = getTearOutTypes(resultSet); return(objHardCard); } catch (Exception ex) { Logger.SaveErr(ex); return(objHardCard); } }
internal static object saveJobDetails(HardCard model) { int result = 0; try { List <SqlParameter> parametersList = new List <SqlParameter>(); parametersList.Add(new SqlParameter("@HardCardID", model.HardCardId)); parametersList.Add(new SqlParameter("@ProjectHeaderId", model.ProjectHeaderId)); parametersList.Add(new SqlParameter("@BidItemHeaderId", model.JobInformationDetails.BidItemHeaderId)); parametersList.Add(new SqlParameter("@CallInRoute", model.JobInformationDetails.CallInRoute)); parametersList.Add(new SqlParameter("@FenceTypeId", model.ContractInformationDetails.FenceType)); parametersList.Add(new SqlParameter("@SpecialComments", model.ContractInformationDetails.SplNotes)); parametersList.Add(new SqlParameter("@LocationDirections", model.ContractInformationDetails.Directions)); parametersList.Add(new SqlParameter("@Scope", model.InstallationDetails.Scope)); parametersList.Add(new SqlParameter("@CBYD", model.InstallationDetails.CBYD)); parametersList.Add(new SqlParameter("@CBYDDate", model.InstallationDetails.CBYDDate)); parametersList.Add(new SqlParameter("@CBYDNumber", model.InstallationDetails.CBYDNumber)); parametersList.Add(new SqlParameter("@EquipmentRequired", model.InstallationDetails.EquipmentRequired)); parametersList.Add(new SqlParameter("@DigTypeID", model.InstallationDetails.DigTypeID)); parametersList.Add(new SqlParameter("@WaterAvailible", model.InstallationDetails.WaterAvailible)); parametersList.Add(new SqlParameter("@ElectricityAvailible", model.InstallationDetails.ElectricityAvailible)); parametersList.Add(new SqlParameter("@MeasureByInstaller", model.InstallationDetails.MeasureByInstaller)); parametersList.Add(new SqlParameter("@LeaveSamplesByInstaller", model.InstallationDetails.LeaveSamplesByInstaller)); parametersList.Add(new SqlParameter("@StartDate", model.InstallationDetails.StartDate)); parametersList.Add(new SqlParameter("@FinishDate", model.InstallationDetails.FinishDate)); parametersList.Add(new SqlParameter("@HardDate", model.InstallationDetails.HardDate)); parametersList.Add(new SqlParameter("@PremakeGate", model.InstallationDetails.PremakeGate)); parametersList.Add(new SqlParameter("@GateDescription1", model.InstallationDetails.GateDescription1)); parametersList.Add(new SqlParameter("@GateInstallationID1", model.InstallationDetails.GateInstallationID1)); parametersList.Add(new SqlParameter("@GateDescription2", model.InstallationDetails.GateDescription2)); parametersList.Add(new SqlParameter("@GateInstallationID2", model.InstallationDetails.GateInstallationID2)); parametersList.Add(new SqlParameter("@GateDescription3", model.InstallationDetails.GateDescription3)); parametersList.Add(new SqlParameter("@GateInstallationID3", model.InstallationDetails.GateInstallationID3)); parametersList.Add(new SqlParameter("@GateDescription4", model.InstallationDetails.GateDescription4)); parametersList.Add(new SqlParameter("@GateInstallationID4", model.InstallationDetails.GateInstallationID4)); parametersList.Add(new SqlParameter("@GateDescription5", model.InstallationDetails.GateDescription5)); parametersList.Add(new SqlParameter("@GateInstallationID5", model.InstallationDetails.GateInstallationID5)); parametersList.Add(new SqlParameter("@BudgetedInstallDays", model.InstallationDetails.BudgetedInstallDays)); parametersList.Add(new SqlParameter("@PoolCode", model.BuildChecklistDetails.PoolCode)); parametersList.Add(new SqlParameter("@BuildForRack", model.BuildChecklistDetails.BuildForRack)); parametersList.Add(new SqlParameter("@SteppingTemp", model.BuildChecklistDetails.SteppingTemp)); parametersList.Add(new SqlParameter("@Dowelled", model.BuildChecklistDetails.Dowelled)); parametersList.Add(new SqlParameter("@Morticed", model.BuildChecklistDetails.Morticed)); parametersList.Add(new SqlParameter("@NailOn", model.BuildChecklistDetails.NailOn)); parametersList.Add(new SqlParameter("@SingleNailed", model.BuildChecklistDetails.SingleNailed)); parametersList.Add(new SqlParameter("@BuildFullSections", model.BuildChecklistDetails.BuildFullSections)); parametersList.Add(new SqlParameter("@FenceDirectionID", model.BuildChecklistDetails.FenceDirectionID)); parametersList.Add(new SqlParameter("@FenceInstallID", model.BuildChecklistDetails.FenceInstallID)); parametersList.Add(new SqlParameter("@Stain", model.BuildChecklistDetails.Stain)); parametersList.Add(new SqlParameter("@StainColor", model.BuildChecklistDetails.StainColor)); parametersList.Add(new SqlParameter("@StainBrand", model.BuildChecklistDetails.StainBrand)); parametersList.Add(new SqlParameter("@TrimInField", model.BuildChecklistDetails.TrimInField)); parametersList.Add(new SqlParameter("@PostPins", model.BuildChecklistDetails.PostPins)); parametersList.Add(new SqlParameter("@TearOutTypeID", model.BuildChecklistDetails.TearOutTypeID)); parametersList.Add(new SqlParameter("@SafetyOfficerOnsite", model.BuildChecklistDetails.SafetyOfficerOnsite)); parametersList.Add(new SqlParameter("@SafteyMeetingOrintationOnsiteReq", model.BuildChecklistDetails.SafteyMeetingOrintationOnsiteReq)); parametersList.Add(new SqlParameter("@SafteyInspectionReqBeforeJobStarts", model.BuildChecklistDetails.SafteyInspectionReqBeforeJobStarts)); parametersList.Add(new SqlParameter("@PPERequired", model.BuildChecklistDetails.PPERequired)); parametersList.Add(new SqlParameter("@EquipmentOperatorCertsReq", model.BuildChecklistDetails.EquipmentOperatorCertsReq)); parametersList.Add(new SqlParameter("@OtherHazards", model.BuildChecklistDetails.OtherHazards)); parametersList.Add(new SqlParameter("@Notes", model.BuildChecklistDetails.Notes)); var id = SqlHelper.ExecuteScalar(_myConnection, CommandType.StoredProcedure, "spATL_PRJ_HardCard_InsUpd", parametersList.ToArray()); result = (Convert.ToInt32(id) == -1) ? 1 : Convert.ToInt32(id); } catch (Exception ex) { Logger.SaveErr(ex); } return(result); }
internal static void getHardCardDetails(HardCard model) { try { var resultSet = SqlHelper.ExecuteDataset(_myConnection, CommandType.StoredProcedure, "spATL_PRJ_HardCard_GetDtls", new SqlParameter("@HardCardID", model.HardCardId)).Tables[0]; if (resultSet.Rows.Count > 0) { var rowItem = resultSet.Rows[0]; model.ProjectHeaderId = Convert.ToInt32(rowItem["ProjectHeaderId"]); model.BidItemHeaderid = Convert.ToInt32(rowItem["BidItemHeaderId"]); if (model.JobInformationDetails == null) { model.JobInformationDetails = new JobInformation(); } if (model.ContractInformationDetails == null) { model.ContractInformationDetails = new ContractorInformation(); } if (model.InstallationDetails == null) { model.InstallationDetails = new Installation(); } if (model.BuildChecklistDetails == null) { model.BuildChecklistDetails = new BuildChecklist(); } model.JobInformationDetails.BidItemHeaderId = Convert.ToInt32(rowItem["BidItemHeaderId"]); model.JobInformationDetails.CallInRoute = Convert.ToString(rowItem["CallInRoute"]); model.ContractInformationDetails.FenceType = Convert.ToString(rowItem["FenceTypeId"]); model.ContractInformationDetails.SplNotes = Convert.ToString(rowItem["SpecialComments"]); model.ContractInformationDetails.Directions = Convert.ToString(rowItem["LocationDirections"]); model.InstallationDetails.PremakeGate = Convert.ToInt32(rowItem["PremakeGate"]); model.InstallationDetails.CBYD = Convert.ToInt32(rowItem["CBYD"]); model.InstallationDetails.CBYDDate = rowItem["CBYDDate"] != DBNull.Value ? Convert.ToDateTime(rowItem["CBYDDate"]).ToShortDateString() : ""; model.InstallationDetails.CBYDNumber = Convert.ToString(rowItem["CBYDNumber"]); model.InstallationDetails.StartDate = rowItem["StartDate"] != DBNull.Value ? Convert.ToDateTime(rowItem["StartDate"]).ToShortDateString() : ""; model.InstallationDetails.FinishDate = rowItem["FinishDate"] != DBNull.Value ? Convert.ToDateTime(rowItem["FinishDate"]).ToShortDateString() : ""; model.InstallationDetails.HardDate = Convert.ToString(rowItem["HardDate"]); model.InstallationDetails.GateDescription1 = Convert.ToString(rowItem["GateDescription1"]); model.InstallationDetails.GateInstallationID1 = Convert.ToString(rowItem["GateInstallationID1"]); model.InstallationDetails.GateDescription2 = Convert.ToString(rowItem["GateDescription2"]); model.InstallationDetails.GateInstallationID2 = Convert.ToString(rowItem["GateInstallationID2"]); model.InstallationDetails.GateDescription3 = Convert.ToString(rowItem["GateDescription3"]); model.InstallationDetails.GateInstallationID3 = Convert.ToString(rowItem["GateInstallationID3"]); model.InstallationDetails.GateDescription4 = Convert.ToString(rowItem["GateDescription4"]); model.InstallationDetails.GateInstallationID4 = Convert.ToString(rowItem["GateInstallationID4"]); model.InstallationDetails.GateDescription5 = Convert.ToString(rowItem["GateDescription5"]); model.InstallationDetails.GateInstallationID5 = Convert.ToString(rowItem["GateInstallationID5"]); model.InstallationDetails.EquipmentRequired = Convert.ToString(rowItem["EquipmentRequired"]); model.InstallationDetails.DigTypeID = Convert.ToInt32(rowItem["DigTypeID"]); model.InstallationDetails.WaterAvailible = Convert.ToInt32(rowItem["WaterAvailible"]); model.InstallationDetails.ElectricityAvailible = Convert.ToInt32(rowItem["ElectricityAvailible"]); model.InstallationDetails.MeasureByInstaller = Convert.ToInt32(rowItem["MeasureByInstaller"]); model.InstallationDetails.LeaveSamplesByInstaller = Convert.ToInt32(rowItem["LeaveSamplesByInstaller"]); model.InstallationDetails.Scope = Convert.ToString(rowItem["Scope"]); model.InstallationDetails.BudgetedInstallDays = Convert.ToDecimal(rowItem["BudgetedInstallDays"]); model.BuildChecklistDetails.PoolCode = Convert.ToInt32(rowItem["PoolCode"]); model.BuildChecklistDetails.BuildForRack = Convert.ToInt32(rowItem["BuildForRack"]); model.BuildChecklistDetails.SteppingTemp = Convert.ToInt32(rowItem["SteppingTemp"]); model.BuildChecklistDetails.Dowelled = Convert.ToInt32(rowItem["Dowelled"]); model.BuildChecklistDetails.Morticed = Convert.ToInt32(rowItem["Morticed"]); model.BuildChecklistDetails.NailOn = Convert.ToInt32(rowItem["NailOn"]); model.BuildChecklistDetails.SingleNailed = Convert.ToInt32(rowItem["SingleNailed"]); model.BuildChecklistDetails.BuildFullSections = Convert.ToInt32(rowItem["BuildFullSections"]); model.BuildChecklistDetails.FenceDirectionID = Convert.ToInt32(rowItem["FenceDirectionID"]); model.BuildChecklistDetails.FenceInstallID = Convert.ToInt32(rowItem["FenceInstallID"]); model.BuildChecklistDetails.Stain = Convert.ToInt32(rowItem["Stain"]); model.BuildChecklistDetails.StainColor = Convert.ToString(rowItem["StainColor"]); model.BuildChecklistDetails.StainBrand = Convert.ToString(rowItem["StainBrand"]); model.BuildChecklistDetails.TrimInField = Convert.ToInt32(rowItem["TrimInField"]); model.BuildChecklistDetails.PostPins = Convert.ToInt32(rowItem["PostPins"]); model.BuildChecklistDetails.TearOutTypeID = Convert.ToInt32(rowItem["TearOutTypeID"]); model.BuildChecklistDetails.SafetyOfficerOnsite = Convert.ToInt32(rowItem["SafetyOfficerOnsite"]); model.BuildChecklistDetails.SafteyMeetingOrintationOnsiteReq = Convert.ToInt32(rowItem["SafteyMeetingOrintationOnsiteReq"]); model.BuildChecklistDetails.SafteyInspectionReqBeforeJobStarts = Convert.ToInt32(rowItem["SafteyInspectionReqBeforeJobStarts"]); model.BuildChecklistDetails.PPERequired = Convert.ToInt32(rowItem["PPERequired"]); model.BuildChecklistDetails.EquipmentOperatorCertsReq = Convert.ToInt32(rowItem["EquipmentOperatorCertsReq"]); model.BuildChecklistDetails.OtherHazards = Convert.ToString(rowItem["OtherHazards"]); model.BuildChecklistDetails.Notes = Convert.ToString(rowItem["Notes"]); } } catch (Exception ex) { Logger.SaveErr(ex); throw; } }