Exemple #1
0
        public static string BuildingPermitApprovedTemplate(BuildingPermit 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>Building Permit</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}&nbsp;&nbsp;&nbsp;- {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);
        }
Exemple #2
0
        public ActionResult Create([Bind(Include = "BuildingPermitId,BuildingTypePermit,ApplicationNumber,AreaNumber,LastName,FirstName,MiddleInitial,TIN,FormOfOwnerShip,OwnerStreetNumber,OwnerStreet,OwnerBarangay,OwnerCity,OwnerZipCode,TelephoneNumber,LocationLotNumber,LocationBlockNumber,LocationTCTNumber,LocationTaxDescriptionNumber,LocationStreet,LocationBarangay,LocationCity,ScopeOfWork,ScopeOfWorkOther,BuildingUse,BuildingUseOther,OccupancyClassified,NumberOfUnits,TotalFloorArea,TotalEstimatedCost,ProposedConstructionDate,ExpectedCompletionDate,CreatedOn,Status,PaymentReference,LocationaClearanceReference")] BuildingPermit buildingpermit, HttpPostedFileBase uploadFile)
        {
            if (uploadFile != null)
            {
                LocationalClearance locational = db.LocationalClearance.Where(z => z.ApplicationNumber == buildingpermit.LocationaClearanceReference).FirstOrDefault();

                if (locational == null)
                {
                    ViewBag.BuildingType = new BuildingTypePermit().ToSelectList();
                    ViewBag.ScopeOfWork  = new ScopeOfWork().ToSelectList();
                    ViewBag.BuildingUse  = new BuildingUse().ToSelectList();
                    return(View(buildingpermit));
                }

                buildingpermit.ApplicationNumber     = GenerateApplicationNumber();
                buildingpermit.Attachment            = base.GetFileBytes(uploadFile);
                buildingpermit.CreatedOn             = DateTime.Now;
                buildingpermit.Status                = "Pending";
                buildingpermit.LocationalClearanceId = locational.LocationalClearanceId;
                db.BuildingPermits.Add(buildingpermit);
                db.SaveChanges();
                return(RedirectToAction("ApplicationSuccess"));
            }


            ViewBag.BuildingType = new BuildingTypePermit().ToSelectList();
            ViewBag.ScopeOfWork  = new ScopeOfWork().ToSelectList();
            ViewBag.BuildingUse  = new BuildingUse().ToSelectList();
            return(View(buildingpermit));
        }
Exemple #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            BuildingPermit buildingpermit = db.BuildingPermits.Find(id);

            db.BuildingPermits.Remove(buildingpermit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "BuildingPermitId,BuildingTypePermit,ApplicationNumber,AreaNumber,LastName,FirstName,MiddleInitial,TIN,FormOfOwnerShip,OwnerStreetNumber,OwnerStreet,OwnerBarangay,OwnerCity,OwnerZipCode,TelephoneNumber,LocationLotNumber,LocationBlockNumber,LocationTCTNumber,LocationTaxDescriptionNumber,LocationStreet,LocationBarangay,LocationCity,ScopeOfWork,ScopeOfWorkOther,BuildingUse,BuildingUseOther,OccupancyClassified,NumberOfUnits,TotalFloorArea,TotalEstimatedCost,ProposedConstructionDate,ExpectedCompletionDate,CreatedOn,Attachment,Status,PaymentReference,LocationaClearanceReference")] BuildingPermit buildingpermit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(buildingpermit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(buildingpermit));
 }
Exemple #5
0
        // GET: /BuildingPermit/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BuildingPermit buildingpermit = db.BuildingPermits.Find(id);

            if (buildingpermit == null)
            {
                return(HttpNotFound());
            }
            return(View(buildingpermit));
        }
Exemple #6
0
        private async Task ApproveBuilding(Payment payment)
        {
            BuildingPermit permit = await db.BuildingPermits.Include(b => b.LocationalClearance).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.LocationalClearance.EmailAddress, "Building Permit Certification", EmailSender.BuildingPermitCertifyTemplate(), EmailSender.CreateAttachment(permit));
            }
        }
Exemple #7
0
        // GET: /BuildingPermit/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BuildingPermit buildingpermit = db.BuildingPermits.Find(id);

            if (buildingpermit == null)
            {
                return(HttpNotFound());
            }

            ViewBag.BuildingType = buildingpermit.BuildingTypePermit.GetEnumDescription();
            ViewBag.ScopeOfWork  = buildingpermit.ScopeOfWork.GetEnumDescription();
            ViewBag.BuildingUse  = buildingpermit.BuildingUse.GetEnumDescription();
            return(View(buildingpermit));
        }
Exemple #8
0
        public static Attachment CreateAttachment(BuildingPermit building)
        {
            Document doc = new Document(new Rectangle(PageSize.A4));
            //Create PDF Table
            PdfPTable  tableLayout = new PdfPTable(4);
            string     fileName    = string.Format("BuildingPermit-{0}-{1}.pdf", building.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(@"BUILDING PERMIT",
                                           new Font(Font.FontFamily.TIMES_ROMAN, 24f, Font.BOLD, BaseColor.BLACK));

            // Setting paragraph's text alignment using iTextSharp.text.Element class
            para.Alignment = Element.ALIGN_CENTER;
            doc.Add(para);
            string scopeOfWork = building.ScopeOfWork.GetEnumDescription();
            string use         = building.BuildingUse.GetEnumDescription();

            if (building.ScopeOfWork == 0)
            {
                scopeOfWork = building.ScopeOfWorkOther;
            }
            if (building.BuildingUse == 0)
            {
                use = building.BuildingUseOther;
            }


            string value = String.Format(@"Permit is issued to {0} {1} for the proposed {2} under {3}, of Group {4}, located at Lot No.{5}Block No.{6}OCT//TCT No. {7}, {8} Street, Barangay {9}, City//Municipality of {10} subject to the following: ",
                                         building.FirstName, building.LastName, scopeOfWork, building.OccupancyClassified, building.LocationLotNumber, building.LocationBlockNumber, building.LocationTCTNumber, building.LocationStreet, building.LocationStreet, building.LocationBarangay, building.LocationCity);

            Paragraph para1 = new Paragraph(value,
                                            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(para1);


            Paragraph para2 = new Paragraph("1. That under Article 1723 of the Civil Code of the Philippines, the engineer or architect who drew up the plans and specifications for a building/structure is liable for damages if within fifteen (15) years from the completion of the building/structure, the same should collapse due to defect intheplans or specifications or defects in the ground. The engineer or architect who supervises the construction shall be solidarily liable with the contractor should the edifice collapse due to defect in the construction or the use of inferior materials.",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, Font.NORMAL, BaseColor.BLACK));

            // Setting paragraph's text alignment using iTextSharp.text.Element class
            para2.FirstLineIndent = 10;
            para2.Alignment       = Element.ALIGN_LEFT;
            // Adding this 'para' to the Document object
            doc.Add(para2);

            Paragraph para3 = new Paragraph("2. This permit shall be accompanied by the various applicable ancillary and accessory permits, plans and specifications signed and sealed by the corresponding design professionals who shall be responsible for the comprehensive and correctness of the plansin compliance to the Code and its IRR and to all applicable referral codes and professional regulatory laws. ",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, Font.NORMAL, BaseColor.BLACK));

            // Setting paragraph's text alignment using iTextSharp.text.Element class
            para3.FirstLineIndent = 10;
            para3.Alignment       = Element.ALIGN_LEFT;
            // Adding this 'para' to the Document object
            doc.Add(para3);

            Paragraph para4 = new Paragraph("3. That no building/structure shall be used until the Building Official has issued a Certificate of Occupancy therefor as provided in the Code. However, a partial Certificate of Occupancy may be issued for the Use/Occupancy of a portion or portions of a building/structure prior to the completion of the entire building/structure. ",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, 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(para3);

            Paragraph para5 = new Paragraph("4.  That this permit shall not serve as an exemption from securing written clearances from various government authorities exercising regulatory function affecting buildings/structures. ",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, Font.NORMAL, BaseColor.BLACK));

            // Setting paragraph's text alignment using iTextSharp.text.Element class
            para5.FirstLineIndent = 10;
            para5.Alignment       = Element.ALIGN_LEFT;
            // Adding this 'para' to the Document object
            doc.Add(para5);

            Paragraph para6 = new Paragraph("5.   When the construction is undertaken by contract, the work shall be done by a duly licensed and registered contractor pursuant to the provisions of the Contractor’s License Law (RA 4566).",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, 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("6.    The Owner/Permittee shall submit a duly accomplished prescribed “Notice of Construction” to the Office of the Building Official prior to any construction activity.",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, 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("7.     The Owner/Permittee shall put a Building Permit sign which complies with the prescribed dimensions and information, which shall remain posted on the construction site for the duration of the construction.",
                                            new Font(Font.FontFamily.TIMES_ROMAN, 10f, 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);

            Image sign = Image.GetInstance(HttpContext.Current.Server.MapPath(string.Format("~/Images/Tomas.png")));

            sign.Alignment = Element.ALIGN_RIGHT;
            sign.ScaleToFit(140f, 120f);
            sign.IndentationRight = 55;
            sign.SpacingBefore    = 15;

            doc.Add(sign);

            Paragraph para12 = new Paragraph("Tomas C. Aguilar, Jr.",
                                             new Font(Font.FontFamily.TIMES_ROMAN, 10f, Font.BOLD, BaseColor.BLACK));

            // Setting paragraph's text alignment using iTextSharp.text.Element class
            para12.IndentationRight = 55;
            para12.Alignment        = Element.ALIGN_RIGHT;
            // Adding this 'para' to the Document object
            doc.Add(para12);

            Paragraph para13 = new Paragraph("Locational Administrator/City Planning and Development Officer",
                                             new Font(Font.FontFamily.TIMES_ROMAN, 10f, 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);


            Paragraph para14 = new Paragraph(" NOTE :  THIS PERMIT MAY BE CANCELLED OR REVOKED PURSUANT TO SECTIONS 305 AND 306 OF THE “NATIONAL BUILDING CODE”",
                                             new Font(Font.FontFamily.TIMES_ROMAN, 10f, Font.NORMAL, BaseColor.BLACK));

            para14.SpacingBefore = 25;
            // Setting paragraph's text alignment using iTextSharp.text.Element class
            para14.Alignment = Element.ALIGN_CENTER;
            // Adding this 'para' to the Document object
            doc.Add(para14);


            doc.Close();

            ContentType ct         = new ContentType(System.Net.Mime.MediaTypeNames.Application.Pdf);
            Attachment  attachment = new Attachment(path);

            attachment.ContentDisposition.FileName = fileName + ".pdf";

            return(attachment);
        }