示例#1
0
        public ActionResult Edit([Bind(Include = "Contract_PO_ID,Client_Contract_ID,Sage_Job,PO_Number,PO_Line,PO_Line_Description,PO_Line_Issued_Date,PO_Line_Billing_Method_ID,Echo_Contact,Customer_Contact,PO_Line_Approved_Amount_Orig,PO_Line_Approved_Amount_Revised,PO_Line_Percent_Work_Completed,PO_Line_Status_ID,PO_Line_Attachment,PO_Line_Notes")] Contract_PO_Line contract_PO_Line, int?clientsiteid, int?clientcontractid, string ponumber, string sagejob, string sort, string sortdir, string issuedoa)
        {
            //strip amount values of commas
            var cats = contract_PO_Line.PO_Line_Approved_Amount_Orig.ToString();

            if (ModelState.IsValid)
            {
                contract_PO_Line.Sage_Job        = contract_PO_Line.Sage_Job.ToUpper();
                db.Entry(contract_PO_Line).State = EntityState.Modified;
                db.SaveChanges();
                if (sort == "" || sort == null)
                {
                    sort = "none";
                }
                if (sortdir == "" || sortdir == null)
                {
                    sortdir = "ASC";
                }
                return(RedirectToAction("Index", new { sort = sort, sortdir = sortdir, sagejob = sagejob, ponumber = ponumber, issuedoa = issuedoa, clientsiteid = clientsiteid, clientcontractid = clientcontractid, _id = contract_PO_Line.Contract_PO_ID }));
            }

            ViewBag.PO_Line_Billing_Method_ID = new SelectList(db.Billing_Method, "Billing_Method_ID", "Billing_Method_Code", contract_PO_Line.PO_Line_Billing_Method_ID);
            ViewBag.Client_Contract_ID        = new SelectList(db.Client_Contract, "Client_Contract_ID", "Contract_Code", contract_PO_Line.Client_Contract_ID);
            ViewBag.PO_Line_Status_ID         = new SelectList(db.Ref_PO_Line_Status, "PO_Line_Status_ID", "PO_Line_Status", contract_PO_Line.PO_Line_Status_ID);
            return(View(contract_PO_Line));
        }
示例#2
0
 public ActionResult Create([Bind(Include = "Contract_PO_ID,Client_Contract_ID,Sage_Job,PO_Number,PO_Line,PO_Line_Description,PO_Line_Issued_Date,PO_Line_Billing_Method_ID,Echo_Contact,Customer_Contact,PO_Line_Approved_Amount_Orig,PO_Line_Approved_Amount_Revised,PO_Line_Percent_Work_Completed,PO_Line_Status_ID,PO_Line_Notes")] Contract_PO_Line contract_PO_Line, int clientsiteid, int?clientcontractid, string sort, string sortdir)
 {
     if (ModelState.IsValid)
     {
         contract_PO_Line.Sage_Job = contract_PO_Line.Sage_Job.ToUpper();
         db.Contract_PO_Line.Add(contract_PO_Line);
         db.SaveChanges();
         if (sort == "" || sort == null)
         {
             sort = "Sage_Job";
         }
         if (sortdir == "" || sortdir == null)
         {
             sortdir = "ASC";
         }
         return(RedirectToAction("Index", new { sort = sort, sortdir = sortdir, ponumber = contract_PO_Line.PO_Number, clientsiteid = clientsiteid, clientcontractid = clientcontractid, _id = contract_PO_Line.Contract_PO_ID }));
     }
     ViewBag.so                        = sort;
     ViewBag.sod                       = sortdir;
     ViewBag.clientsiteid              = clientsiteid;
     ViewBag.clientcontractid          = clientcontractid;
     ViewBag.PO_Line_Billing_Method_ID = new SelectList(db.Billing_Method, "Billing_Method_ID", "Billing_Method_Code", contract_PO_Line.PO_Line_Billing_Method_ID);
     ViewBag.Client_Contract_ID        = new SelectList(db.Client_Contract, "Client_Contract_ID", "Contract_Code", contract_PO_Line.Client_Contract_ID);
     ViewBag.PO_Line_Status_ID         = new SelectList(db.Ref_PO_Line_Status, "PO_Line_Status_ID", "PO_Line_Status");
     return(View(contract_PO_Line));
 }
示例#3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Contract_PO_Line contract_PO_Line = db.Contract_PO_Line.Find(id);

            db.Contract_PO_Line.Remove(contract_PO_Line);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#4
0
        // GET: Contract/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Contract_PO_Line contract_PO_Line = db.Contract_PO_Line.Find(id);

            if (contract_PO_Line == null)
            {
                return(HttpNotFound());
            }
            return(View(contract_PO_Line));
        }
示例#5
0
        // GET: Contract/Edit/5
        public ActionResult Edit(int?id, int?clientsiteid, int?clientcontractid, string ponumber, string sagejob, string sort, string sortdir, string issuedoa)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Contract_PO_Line contract_PO_Line = db.Contract_PO_Line.Find(id);

            if (contract_PO_Line == null)
            {
                return(HttpNotFound());
            }
            ViewBag.pon                       = ponumber;
            ViewBag.sj                        = sagejob;
            ViewBag.so                        = sort;
            ViewBag.sod                       = sortdir;
            ViewBag.ioa                       = issuedoa;
            ViewBag.clientsiteid              = clientsiteid;
            ViewBag.clientcontractid          = clientcontractid;
            ViewBag.PO_Line_Billing_Method_ID = new SelectList(db.Billing_Method, "Billing_Method_ID", "Billing_Method_Code", contract_PO_Line.PO_Line_Billing_Method_ID);
            ViewBag.Client_Contract_ID        = new SelectList(db.Client_Contract.Where(s => s.Client_Site_ID == clientsiteid), "Client_Contract_ID", "Contract_Code", contract_PO_Line.Client_Contract_ID);
            ViewBag.PO_Line_Status_ID         = new SelectList(db.Ref_PO_Line_Status, "PO_Line_Status_ID", "PO_Line_Status", contract_PO_Line.PO_Line_Status_ID);
            return(View(contract_PO_Line));
        }