public ActionResult EditpaymentStatus(int id)
        {
            PaymentDetail paymentDetail = db.PaymentDetails.FirstOrDefault(p => p.Id == id);

            paymentDetail.StatusId        = 10;
            db.Entry(paymentDetail).State = EntityState.Modified;
            db.SaveChanges();
            var qid = paymentDetail.QuoteId;

            //return View("ViewInvoice");
            return(Redirect("../ViewInvoice/" + qid));
        }
        public bool UpdatePassword(string Email, string Password)
        {
            bool       status = false;
            UserDetail user   = db.UserDetails.Where(x => x.Email == Email).FirstOrDefault();

            user.Password        = Password;
            db.Entry(user).State = EntityState.Modified;
            if (db.SaveChanges() > 0)
            {
                status = true;
            }
            return(status);
        }
Ejemplo n.º 3
0
 public ActionResult UploadDocument(HttpPostedFileBase [] documents, [Bind(Include = "QuoteId,VehicleId,UserId,Duration,DownPayment,TotalAmount,StatusId,Details,IsActive,IsDelete")] Quote quote)
 {
     try
     {
         List <Document> doc = new List <Document>();
         foreach (var item in documents)
         {
             byte[] bytes;
             using (BinaryReader br = new BinaryReader(item.InputStream))
             {
                 bytes = br.ReadBytes(item.ContentLength);
             }
             Document document = new Document()
             {
                 DocName        = item.FileName,
                 DocContentType = item.ContentType,
                 DocData        = bytes,
                 QuoteId        = quote.QuoteId
             };
             doc.Add(document);
         }
         db.Documents.AddRange(doc);
         var st = db.SaveChanges();
         if (st > 0)
         {
             quote.StatusId        = 4;
             db.Entry(quote).State = EntityState.Modified;
             db.SaveChanges();
         }
         return(RedirectToAction("QuoteList"));
     }
     catch (Exception e)
     {
         return(Redirect("../QuoteDetails/" + quote.QuoteId));
     }
 }
Ejemplo n.º 4
0
 public ActionResult DeleteRecord(int id)
 {
     if (ModelState.IsValid)
     {
         var vd = db.VehicleDetails.Include("VehicleImages").FirstOrDefault(v => v.VehicleId == id);
         //VehicleDetail vehicle = db.VehicleDetails.Find(id);
         vd.IsDelete        = true;
         db.Entry(vd).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     else
     {
         ModelState.AddModelError("", "Record Not deleted");
     }
     return(View());
 }