public static string ZoningClearanceApprovedTemplate(ZoningClearance permit, List <Fee> fees) { string result = String.Format(@"<br> Good Day! <br/> <br/> <br/> <br/> <div style=""margin-left:30px;""> This is to inform you that your application for <b>Zoning Clearance</b> has been <b>APPROVED</b>. <br/> <br/> Your Reference Number for the permits payment is <b>{0}</b> <br/> <br/> The following are your fees for this application: <br/> <br/>", permit.PaymentReference); float total = 0; foreach (var item in fees) { total += item.Price; result += string.Format("P{0} - {1} <br/><br/>", item.Price, item.Description); } result += "P" + total + " - <b>TOTAL</b> <br/><br/> "; result += String.Format("For us to verify your payment, kindly click this <a href=\"{0}\">link</a> upon settling your account. <br/><br/>", GetPaymentUrl()); result += " </div><br/><br/><br/><br/> Thank you for using the service. Have a nice day!"; return(result); }
public ActionResult DeleteConfirmed(int id) { ZoningClearance zoningclearance = db.ZoningClearance.Find(id); db.ZoningClearance.Remove(zoningclearance); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ZoningClearanceId,ApplicationNumber,DateApplied,BusinessName,OwnerName,BusinessAddress,BusinessNature,ContactNumber,MainOffice,TotalFloorArea,FloorAreaBusiness,Attachments,EmailAddress")] ZoningClearance zoningclearance) { if (ModelState.IsValid) { db.Entry(zoningclearance).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(zoningclearance)); }
public ActionResult DisqualifyApplication(int?id) { ZoningClearance zoningclearance = db.ZoningClearance.Find(id); if (zoningclearance == null) { return(HttpNotFound()); } zoningclearance.Status = "Denied"; db.Entry(zoningclearance).State = EntityState.Modified; db.SaveChanges(); EmailSender.SendMail(zoningclearance.EmailAddress, "Zoning Clearance Application : Denied", EmailSender.ZoningClearanceDeniedTemplate()); return(RedirectToAction("Index")); }
// GET: /ZoningForm/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ZoningClearance zoningclearance = db.ZoningClearance.Find(id); if (zoningclearance == null) { return(HttpNotFound()); } return(View(zoningclearance)); }
public ActionResult Create([Bind(Include = "ZoningClearanceId,ApplicationNumber,DateApplied,BusinessName,OwnerName,BusinessAddress,BusinessNature,ContactNumber,MainOffice,TotalFloorArea,FloorAreaBusiness,EmailAddress,Fees")] ZoningClearance zoningclearance, HttpPostedFileBase attachments) { if (attachments != null) { zoningclearance.Attachments = base.GetFileBytes(attachments); zoningclearance.DateApplied = DateTime.Now; zoningclearance.ApplicationNumber = GenerateApplicationNumber(); zoningclearance.Status = "Pending"; zoningclearance.Fees = db.Fees.Include(p => p.ApplicationType).Where(p => p.ApplicationType.Description.Contains("Zoning")).ToList(); db.ZoningClearance.Add(zoningclearance); db.SaveChanges(); return(RedirectToAction("ApplicationSuccess")); } return(View(zoningclearance)); }
private async Task ApproveZoning(Payment payment) { ZoningClearance permit = await db.ZoningClearance.SingleOrDefaultAsync(z => z.PaymentReference == payment.ReferenceNumber); if (permit != null) { permit.Status = "Paid"; payment.Status = "Confirmed"; payment.TotalPayment = permit.TotalPayment; db.Entry(permit).State = EntityState.Modified; db.Entry(payment).State = EntityState.Modified; await db.SaveChangesAsync(); // email ung attachment with congratulations EmailSender.SendMail(permit.EmailAddress, "Zoning Clearance Certification", EmailSender.ZoningClearanceCertifyTemplate(), EmailSender.CreateAttachment(permit)); } }
public ActionResult ApproveApplication(int?id) { ZoningClearance zoningclearance = db.ZoningClearance.Find(id); List <Fee> fees = db.Fees.Include(p => p.ApplicationType).Where(p => p.ApplicationType.Description.Contains("Locational")).ToList(); if (zoningclearance == null) { return(HttpNotFound()); } zoningclearance.Status = "Approved"; zoningclearance.TotalPayment = fees.Sum(f => f.Price); zoningclearance.PaymentReference = base.RandomString(); db.Entry(zoningclearance).State = EntityState.Modified; db.SaveChanges(); EmailSender.SendMail(zoningclearance.EmailAddress, "Zoning Clearance Application : Approved", EmailSender.ZoningClearanceApprovedTemplate(zoningclearance, fees)); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id,IsNew,BusinessAccountNumber,DateApplied,BusinessName,OwnerName,BusinessAddress,BusinessNature,DeliveryVehicles,TotalAreaBusiness,ContactNumber,TotalEmployee,RentedOwnerName,MonthlyRental,JanGrossReceipt,FebGrossReceipt,MarGrossReceipt,AprGrossReceipt,MayGrossReceipt,JunGrossReceipt,JulGrossReceipt,AugGrossReceipt,SepGrossReceipt,OctGrossReceipt,NovGrossReceipt,DecGrossReceipt,TotalGrossReceipt,CapitalInvestment,DateStartedRemarks,CapitalInvestmentRemarks,AreaRemarks,GrossSalesPerDay,GrossSalesPerYear,PreviousBasisLicenseTax,CurrentBasisLicenseTax,AssessedAmount,Status,ZoningClearanceReferenceNumber")] BusinessPermit.Models.BusinessPermit businesspermit, HttpPostedFileBase uploadFile) { if (uploadFile != null) { businesspermit.Attachments = base.GetFileBytes(uploadFile); businesspermit.DateApplied = DateTime.Now; businesspermit.Status = "Pending"; ZoningClearance zoning = db.ZoningClearance.Where(z => z.ApplicationNumber == businesspermit.ZoningClearanceReferenceNumber).FirstOrDefault(); if (zoning == null) { return(View(businesspermit)); } if (businesspermit.IsNew == false) { BusinessPermit.Models.BusinessPermit previous = db.BusinessPermits.Where(z => z.BusinessAccountNumber == businesspermit.BusinessAccountNumber).OrderBy(p => p.DateApplied).FirstOrDefault(); if (previous != null) { if (previous.TotalGrossReceipt > businesspermit.TotalGrossReceipt) { businesspermit.TotalGrossReceipt = previous.TotalGrossReceipt; } } } businesspermit.BusinessAddress = zoning.BusinessAddress; businesspermit.BusinessName = zoning.BusinessName; businesspermit.BusinessNature = zoning.BusinessNature; businesspermit.OwnerName = zoning.OwnerName; businesspermit.ZoningClearanceId = zoning.ZoningClearanceId; db.BusinessPermits.Add(businesspermit); db.SaveChanges(); return(RedirectToAction("ApplicationSuccess")); } return(View(businesspermit)); }
public static Attachment CreateAttachment(ZoningClearance zoning) { Document doc = new Document(new Rectangle(PageSize.A4)); //Create PDF Table PdfPTable tableLayout = new PdfPTable(4); string fileName = string.Format("ZoningClearance-{0}-{1}.pdf", zoning.ApplicationNumber, DateTime.Now.ToShortDateString().Replace("/", "")); string path = HttpContext.Current.Server.MapPath(string.Format("~/App_Data/{0}", fileName)); FileStream fm = new FileStream(path, FileMode.Create); //Create a PDF file in specific path PdfWriter.GetInstance(doc, fm); //Open the PDF document doc.Open(); Paragraph para = new Paragraph(@"Republic of the Philippines", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para.Alignment = Element.ALIGN_CENTER; doc.Add(para); Paragraph para1 = new Paragraph("City of Marikina", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para1.Alignment = Element.ALIGN_CENTER; doc.Add(para1); Paragraph para2 = new Paragraph("Business Permit Licensing Office", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para2.Alignment = Element.ALIGN_CENTER; doc.Add(para2); //Add Content to PDF Paragraph para3 = new Paragraph("ZONING CLEARANCE is hereby GRANTED TO " + zoning.OwnerName + " which is conforming as to Land Use Classification of the site per Zoning Ordinance No. 161, series of 2006 subject to the following conditions: ", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para3.SpacingBefore = 25; para3.SpacingAfter = 15; para3.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para3); Paragraph para4 = new Paragraph("1. That this clearance shall be posted in a conspicuous place within the premises/business during construction/operation.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para4.FirstLineIndent = 10; para4.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para4); Paragraph para6 = new Paragraph("2. That any material falsehood or misrepresentation of the documents submitted made in connection with the said application shall render the clearance null and void from the beginning.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para6.FirstLineIndent = 10; para6.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para6); Paragraph para7 = new Paragraph("3. That the implementation of the proposal should commence within a period of one year from the date of issuance of this clearance otherwise the proponent should re-apply for a new location clearance.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para7.FirstLineIndent = 10; para7.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para7); Paragraph para8 = new Paragraph("4. That this office reserves the rights to inspect and review said project/operation and subsequently institute cancellation proceedings should the same be found in violation in any of the herein conditions and other pertinent government policies, rules and regulations.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para8.FirstLineIndent = 10; para8.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para8); Paragraph para9 = new Paragraph("5. That this clearance shall not, in any way, be interpreted to vest any title, right of ownership, or the right of possession of the land herein.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para9.FirstLineIndent = 10; para9.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para9); Paragraph para10 = new Paragraph("6. That no additional business shall be done without the approval of this office.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para10.FirstLineIndent = 10; para10.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para10); Paragraph para11 = new Paragraph("7. The other provisions set forth in the Business Code (P.D. 1096) relative to this activity shall be complied with.", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para11.FirstLineIndent = 10; para11.Alignment = Element.ALIGN_LEFT; // Adding this 'para' to the Document object doc.Add(para11); Image sign = Image.GetInstance(HttpContext.Current.Server.MapPath(string.Format("~/Images/Other.png"))); sign.Alignment = Element.ALIGN_RIGHT; sign.ScaleToFit(140f, 120f); sign.IndentationRight = 35; sign.SpacingBefore = 15; doc.Add(sign); Paragraph para12 = new Paragraph("Atty. Nancy V. Taylan", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.BOLD, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para12.IndentationRight = 35; para12.Alignment = Element.ALIGN_RIGHT; // Adding this 'para' to the Document object doc.Add(para12); Paragraph para13 = new Paragraph("Locational Administrator/Business Permit Licensing Office", new Font(Font.FontFamily.TIMES_ROMAN, 12f, Font.NORMAL, BaseColor.BLACK)); // Setting paragraph's text alignment using iTextSharp.text.Element class para13.Alignment = Element.ALIGN_RIGHT; // Adding this 'para' to the Document object doc.Add(para13); // Closing the document doc.Close(); ContentType ct = new ContentType(System.Net.Mime.MediaTypeNames.Application.Pdf); Attachment attachment = new Attachment(path); attachment.ContentDisposition.FileName = fileName + ".pdf"; return(attachment); }