コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            inv inv = db.invs.Find(id);

            db.invs.Remove(inv);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "id,Invoice_No,Invoice_Date,Store,Item,Unit,Price,Qty,Total,Discount,Net,Total_All,Taxes_All,Net_All")] inv inv)
 {
     if (ModelState.IsValid)
     {
         db.Entry(inv).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(inv));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "id,inv_num,purchase,cost,description,location,contact")] inv inv)
 {
     if (ModelState.IsValid)
     {
         db.Entry(inv).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.contact = new SelectList(db.employees, "id", "first_name", inv.contact);
     return(View(inv));
 }
コード例 #4
0
        // GET: invs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            inv inv = db.invs.Find(id);

            if (inv == null)
            {
                return(HttpNotFound());
            }
            return(PartialView(inv));
        }
コード例 #5
0
        // GET: invs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            inv inv = db.invs.Find(id);

            if (inv == null)
            {
                return(HttpNotFound());
            }
            ViewBag.contact = new SelectList(db.employees, "id", "first_name", inv.contact);
            return(PartialView(inv));
        }
コード例 #6
0
        public ActionResult Create(inv inv)
        {
            if (ModelState.IsValid)
            {
                int x  = 0;
                int i  = 0;
                inv vv = new inv();
                NameValueCollection nvc = Request.Form;
                while (x == 0)
                {
                    string ii = i.ToString();
                    if (nvc["Item" + ii] != null)
                    {
                        inv v = new inv();
                        v.id           = inv.id;
                        v.Invoice_No   = inv.Invoice_No;
                        v.Invoice_Date = inv.Invoice_Date;
                        v.Store        = inv.Store;
                        v.Item         = nvc["Item" + ii];
                        v.Unit         = nvc["Unit" + ii];
                        v.Price        = nvc["Price" + ii];
                        v.Qty          = nvc["Qty" + ii];
                        v.Discount     = nvc["Discount" + ii];
                        v.Net          = nvc["Net" + ii];
                        v.Taxes_All    = inv.Taxes_All;
                        v.Total_All    = inv.Total_All;
                        v.Net_All      = inv.Net_All;
                        db.invs.Add(v);
                        db.SaveChanges();
                        i++;
                    }
                    if (nvc["Item" + ii] == null)
                    {
                        x = 6;
                    }
                }

                return(View());
            }

            return(View(inv));
        }
コード例 #7
0
ファイル: Invalid.cs プロジェクト: YevgeniyGertsen/Human
 public Invalid(inv inv, double allowance) : base()
 {
     base.inv       = inv;
     this.allowance = allowance;
 }
コード例 #8
0
ファイル: Invalid.cs プロジェクト: YevgeniyGertsen/Human
 public Invalid(inv inv) : this(inv, 0)
 {
 }