Exemplo n.º 1
0
        public ActionResult generateQuotation(pquotation c)
        {
            pquotation p = db.pquotations.Where(x => x.quotationId == c.quotationId).FirstOrDefault();
            pquotation a = new pquotation();

            a.productId = c.productId;

            a.availability = c.availability;
            a.category     = c.category;
            a.color        = c.color;
            a.description  = c.description;
            a.name         = c.name;
            product d = db.products.Where(x => x.productId == c.productId).FirstOrDefault();

            a.vendorId     = d.userId;
            a.quantity     = c.quantity;
            a.userId       = Session["userid"].ToString();
            a.status       = "pending";
            a.vendorStatus = "pending";

            db.pquotations.Remove(db.pquotations.Where(x => x.productId == d.productId).FirstOrDefault());
            db.pquotations.Add(a);

            db.SaveChanges();
            return(View("quotationRequested"));
        }
Exemplo n.º 2
0
        public ActionResult vendorQuotation(pquotation c)
        {
            pquotation p = db.pquotations.Where(x => x.quotationId == c.quotationId).FirstOrDefault();
            pquotation a = new pquotation();


            var p1 = db.products.Where(x => x.productId == c.productId).FirstOrDefault();

            a.availability = p.availability;
            a.productId    = p.productId;
            a.category     = p.category;
            a.color        = p.color;
            a.description  = p.description;
            a.name         = p.name;
            var d = db.products.Where(x => x.productId == a.productId).FirstOrDefault();

            a.userId       = p.userId;
            a.quantity     = 2;
            a.vendorId     = Session["userid"].ToString();
            a.status       = "pending";
            a.quotation    = c.quotation;
            a.vendorStatus = "accept";
            db.pquotations.Remove(db.pquotations.Where(x => x.productId == p.productId).FirstOrDefault());
            db.pquotations.Add(a);
            db.SaveChanges();
            return(View("quotationSubmitted"));
        }
Exemplo n.º 3
0
        public ActionResult approveQuotation(int id)
        {
            pquotation c = db.pquotations.Where(a => a.quotationId == id).FirstOrDefault();

            if (c.vendorStatus == "pending")
            {
                return(View("quotationStatusPending"));
            }
            else
            {
                return(RedirectToAction("Agreement", c));
            }
        }
Exemplo n.º 4
0
        public ActionResult generateQuotation(int id)
        {
            pquotation a = new pquotation();

            a.productId = id;
            var p = db.products.Where(x => x.productId == id).FirstOrDefault();

            a.description  = p.description;
            a.name         = p.name;
            a.category     = p.category;
            a.color        = p.color;
            a.productId    = id;
            a.availability = p.availability;
            a.vendorId     = p.userId;
            a.quantity     = 1;
            a.userId       = Session["userid"].ToString();
            a.status       = "pending";
            a.vendorStatus = "pending";
            db.pquotations.Add(a);
            db.SaveChanges();

            return(View(a));
        }
Exemplo n.º 5
0
 public ActionResult Agreement(pquotation p)
 {
     return(View(p));
 }