Exemple #1
0
        public ActionResult addDocDesc(string oper, DocDescGridModel DocDesc, string vbPropertyId)
        {
            var context = new EFRepository();

            //int propId = Convert.ToInt32(ViewData["vbPropertyId"]);
            int propId = Convert.ToInt32(vbPropertyId);

            if (oper.Equals("add"))
            {
                EFDocDesc doc = new EFDocDesc();
                doc.Id         = 0;
                doc.PropertyId = Convert.ToInt32(vbPropertyId);
                doc.Type       = DocDesc.Type;
                doc.Desc       = DocDesc.Desc;
                doc.ExpireDate = Convert.ToDateTime(DocDesc.ExpireDate);
                doc.CreateDate = Convert.ToDateTime(DocDesc.CreateDate);
                doc.FileName   = DocDesc.FileName;
                context.EFDocDescs.Add(doc);
                context.SaveChanges();

                EFDocHist hist = new EFDocHist();
                hist.EFDocDescId = doc.Id;
                hist.Date        = DateTime.Now;
                hist.Action      = "request";
                context.EFDocHists.Add(hist);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
Exemple #2
0
        public ActionResult genericDocDescList(string vbPropertyId)
        {
            var context = new EFRepository();

            //int propId = Convert.ToInt32(ViewData["vbPropertyId"]);
            int propId = Convert.ToInt32(vbPropertyId);


            DateTime now = DateTime.Now;

            for (int x = 0; x < 4; x++)
            {
                EFDocDesc doc = new EFDocDesc();
                doc.Id         = 0;
                doc.PropertyId = Convert.ToInt32(vbPropertyId);
                doc.Type       = "Paystub";
                doc.Desc       = "Most Recent";
                doc.ExpireDate = now;
                doc.CreateDate = now;
                doc.FileName   = "";
                context.EFDocDescs.Add(doc);
                context.SaveChanges();

                EFDocHist hist = new EFDocHist();
                hist.EFDocDescId = doc.Id;
                hist.Date        = now;
                hist.Action      = "Request";
                context.EFDocHists.Add(hist);
                context.SaveChanges();
            }

            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult addLien(string oper, LienSumGridModel addLien, string vbPropertyId)
        {
            var context = new EFRepository();

            if (oper.Equals("add"))
            {
                EFLien lien = new EFLien();
                lien.Id                = 0;
                lien.PropertyId        = Convert.ToInt32(vbPropertyId);
                lien.ReviewDate        = addLien.ReviewDate == null ? (DateTime?)null : Convert.ToDateTime(addLien.ReviewDate);
                lien.Type              = addLien.Type;
                lien.Servicer          = addLien.Servicer;
                lien.AccountNo         = addLien.AccountNo;
                lien.LienPosition      = addLien.LienPosition;
                lien.SettlementAmt     = Convert.ToDecimal(addLien.SettlementAmt);
                lien.SettlementDate    = addLien.SettlementDate == null ? (DateTime?)null : Convert.ToDateTime(addLien.SettlementDate);
                lien.Status            = addLien.Status;
                lien.MinNetProceeds    = Convert.ToDecimal(addLien.MinNetProceeds);
                lien.MaxNetProceeds    = Convert.ToDecimal(addLien.MaxNetProceeds);
                lien.Valuation         = Convert.ToDecimal(addLien.Valuation);
                lien.ValuationDate     = addLien.ValuationDate == null ? (DateTime?)null : Convert.ToDateTime(addLien.ValuationDate);
                lien.PayoffAmt         = Convert.ToDecimal(addLien.PayoffAmt);
                lien.PayoffDate        = addLien.PayoffDate == null ? (DateTime?)null : Convert.ToDateTime(addLien.PayoffDate);
                lien.SettlementProgram = addLien.SettlementProgram;
                lien.FHA               = addLien.FHA;
                lien.Investor          = addLien.Investor;

                context.EFLiens.Add(lien);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult addContact(string oper, SellerSumGridModel addContact, string vbPropertyId)
        {
            var context = new EFRepository();

            if (oper.Equals("add"))
            {
                EFContact contact = new EFContact();
                contact.Id         = 0;
                contact.PropertyId = Convert.ToInt32(vbPropertyId);
                contact.FirstName  = addContact.FirstName;
                contact.LastName   = addContact.LastName;
                contact.Role       = addContact.Role;
                contact.Email      = addContact.Email;
                if (addContact.AutoStatusUpdate == "True")
                {
                    contact.AutoStatusUpdate = true;
                }
                else
                {
                    contact.AutoStatusUpdate = false;
                }

                context.EFContacts.Add(contact);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult editLien(string oper, LienSumGridModel editLien, string id)
        {
            var context = new EFRepository();

            if (oper.Equals("edit"))
            {
                EFLien lien = new EFLien();
                lien.Id                = Convert.ToInt32(editLien.Id);
                lien.PropertyId        = Convert.ToInt32(editLien.PropertyId);
                lien.ReviewDate        = editLien.ReviewDate == null ? (DateTime?)null : Convert.ToDateTime(editLien.ReviewDate);
                lien.Type              = editLien.Type;
                lien.Servicer          = editLien.Servicer;
                lien.AccountNo         = editLien.AccountNo;
                lien.LienPosition      = editLien.LienPosition;
                lien.SettlementAmt     = Convert.ToDecimal(editLien.SettlementAmt);
                lien.SettlementDate    = editLien.SettlementDate == null ? (DateTime?)null : Convert.ToDateTime(editLien.SettlementDate);
                lien.Status            = editLien.Status;
                lien.MinNetProceeds    = Convert.ToDecimal(editLien.MinNetProceeds);
                lien.MaxNetProceeds    = Convert.ToDecimal(editLien.MaxNetProceeds);
                lien.Valuation         = Convert.ToDecimal(editLien.Valuation);
                lien.ValuationDate     = editLien.ValuationDate == null ? (DateTime?)null : Convert.ToDateTime(editLien.ValuationDate);
                lien.PayoffAmt         = Convert.ToDecimal(editLien.PayoffAmt);
                lien.PayoffDate        = editLien.PayoffDate == null ? (DateTime?)null : Convert.ToDateTime(editLien.PayoffDate);
                lien.SettlementProgram = editLien.SettlementProgram;
                lien.FHA               = editLien.FHA;
                lien.Investor          = editLien.Investor;
                context.EFLiens.Attach(lien);
                context.Entry(lien).State = EntityState.Modified;
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult editContact(string oper, SellerSumGridModel editContact)
        {
            var context = new EFRepository();

            if (oper.Equals("edit"))
            {
                EFContact contact = new EFContact();
                contact.Id         = Convert.ToInt32(editContact.Id);
                contact.PropertyId = Convert.ToInt32(editContact.PropertyId);
                contact.FirstName  = editContact.FirstName;
                contact.LastName   = editContact.LastName;
                contact.Role       = editContact.Role;
                contact.Email      = editContact.Email;
                if (editContact.AutoStatusUpdate == "True")
                {
                    contact.AutoStatusUpdate = true;
                }
                else
                {
                    contact.AutoStatusUpdate = false;
                }

                context.Entry(contact).State = EntityState.Modified;
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
Exemple #7
0
        // id is rowid and primary key of DocDesc record
        public ActionResult editDocDesc(string oper, EFDocDesc editDocDesc, string id)
        {
            var context = new EFRepository();

            if (oper.Equals("edit"))
            {
                editDocDesc.Id = Convert.ToInt32(id);
                context.EFDocDescs.Attach(editDocDesc);
                context.Entry(editDocDesc).State = EntityState.Modified;
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
Exemple #8
0
        // id is rowid and primary key of DocDesc record
        public ActionResult deleteDocDesc(string oper, string id)
        {
            var context = new EFRepository();

            if (oper.Equals("del"))
            {
                EFDocDesc deleteDocDesc = new EFDocDesc()
                {
                    Id = Convert.ToInt32(id)
                };
                context.EFDocDescs.Attach(deleteDocDesc);
                context.EFDocDescs.Remove(deleteDocDesc);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult addContact(string oper, LienContactGridModel addContact, string selectedLienId)
        {
            var context = new EFRepository();

            if (oper.Equals("add"))
            {
                EFLienContact contact = new EFLienContact();
                contact.Id        = 0;
                contact.LienId    = Convert.ToInt32(selectedLienId);
                contact.FirstName = addContact.FirstName;
                contact.LastName  = addContact.LastName;
                contact.Role      = addContact.Role;
                context.EFLienContacts.Add(contact);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult editContact(string oper, LienContactGridModel editContact)
        {
            var context = new EFRepository();

            if (oper.Equals("edit"))
            {
                EFLienContact contact = new EFLienContact();
                contact.Id                   = Convert.ToInt32(editContact.Id);
                contact.LienId               = Convert.ToInt32(editContact.LienId);
                contact.FirstName            = editContact.FirstName;
                contact.LastName             = editContact.LastName;
                contact.Role                 = editContact.Role;
                context.Entry(contact).State = EntityState.Modified;
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult addProperty(string oper, EFProperty addProperty)
        {
            var context = new EFRepository();

            if (oper.Equals("add"))
            {
                EFProperty p = new EFProperty();
                p.Id      = 0;
                p.Type    = addProperty.Type;
                p.Address = addProperty.Address;
                p.City    = addProperty.City;
                p.State   = addProperty.State;
                p.Zip     = addProperty.Zip;
                context.EFProperties.Add(p);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult editProperty(string oper, PropSumGridModel editProperty)
        {
            var context = new EFRepository();

            if (oper.Equals("edit"))
            {
                EFProperty p = new EFProperty();
                p.Id      = Convert.ToInt32(editProperty.Id);
                p.Type    = editProperty.Type;
                p.Address = editProperty.Address;
                p.City    = editProperty.City;
                p.State   = editProperty.State;
                p.Zip     = editProperty.Zip;
                context.Entry(p).State = EntityState.Modified;
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult addOffer(string oper, OfferSumGridModel addOffer, string vbPropertyId)
        {
            var context = new EFRepository();

            if (oper.Equals("add"))
            {
                EFOffer offer = new EFOffer();
                offer.Id         = 0;
                offer.PropertyId = Convert.ToInt32(vbPropertyId);
                offer.OfferDate  = Convert.ToDateTime(addOffer.OfferDate);
                offer.OfferAmt   = Convert.ToDecimal(addOffer.OfferAmt);
                offer.ExpireDate = Convert.ToDateTime(addOffer.ExpireDate);
                offer.Status     = addOffer.Status;
                context.EFOffers.Add(offer);
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        // id is rowid and primary key of Offer record
        public ActionResult editOffer(string oper, OfferSumGridModel editOffer, string id)
        {
            var context = new EFRepository();

            if (oper.Equals("edit"))
            {
                EFOffer offer = new EFOffer();
                offer.Id         = Convert.ToInt32(editOffer.Id);
                offer.PropertyId = Convert.ToInt32(editOffer.PropertyId);
                offer.OfferDate  = Convert.ToDateTime(editOffer.OfferDate);
                offer.OfferAmt   = Convert.ToDecimal(editOffer.OfferAmt);
                offer.ExpireDate = Convert.ToDateTime(editOffer.ExpireDate);
                offer.Status     = editOffer.Status;
                context.EFOffers.Attach(offer);
                context.Entry(offer).State = EntityState.Modified;
                context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }
        public ActionResult deleteProperty(string oper, string id)
        {
            var context = new EFRepository();

            if (oper.Equals("del"))
            {
                int propId   = Convert.ToInt32(id);
                var property = (from p
                                in context.EFProperties
                                where p.Id == propId
                                select p).Single();

                property.isDeleted            = true;
                context.Entry(property).State = EntityState.Modified;
                context.SaveChanges();

                //EFProperty deleteProperty = new EFProperty() { Id = Convert.ToInt32(id) };
                //context.EFProperties.Attach(deleteProperty);
                //context.EFProperties.Remove(deleteProperty);
                //context.SaveChanges();
            }
            return(Json(JSONResponseFactory.SuccessResponse()));
        }