예제 #1
0
        public ActionResult Create([Bind(Include = "customerCode,name,address,city,state,zipCode,id")] tbl_customer tbl_customer)
        {
            if (ModelState.IsValid)
            {
                db.tbl_customer.Add(tbl_customer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_customer));
        }
예제 #2
0
        public ActionResult Create([Bind(Include = "customerCode,machineID,eqpmtType,id")] tbl_customer_eqpmt tbl_customer_eqpmt)
        {
            if (ModelState.IsValid)
            {
                db.tbl_customer_eqpmt.Add(tbl_customer_eqpmt);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.customerCode = new SelectList(db.tbl_customer, "customerCode", "name", tbl_customer_eqpmt.customerCode);
            return(View(tbl_customer_eqpmt));
        }
        public ActionResult DeleteAvlblKit(tbl_eqpmt_kits_avlbl avlblKitDelete)
        {
            tbl_eqpmt_kits_avlbl tbl_eqpmt_kits_avlbl = db.tbl_eqpmt_kits_avlbl.Find(avlblKitDelete.id);

            db.tbl_eqpmt_kits_avlbl.Remove(tbl_eqpmt_kits_avlbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #4
0
        public ActionResult DeleteKit(tbl_kit kitDelete)
        {
            tbl_kit tbl_kit = db.tbl_kit.Find(kitDelete.id);

            db.tbl_kit.Remove(tbl_kit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #5
0
        public ActionResult DeleteEqpmtType(tbl_eqpmt_type_mgmt eqpmtTypeDelete)
        {
            tbl_eqpmt_type_mgmt tbl_eqpmt_type_mgmt = db.tbl_eqpmt_type_mgmt.Find(eqpmtTypeDelete.id);

            db.tbl_eqpmt_type_mgmt.Remove(tbl_eqpmt_type_mgmt);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteEvent(tbl_customer_event eventDelete)
        {
            tbl_customer_event tbl_customer_event = db.tbl_customer_event.Find(eventDelete.id);

            db.tbl_customer_event.Remove(tbl_customer_event);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtDelete)
        {
            tbl_eqpmt_kits_current tbl_eqpmt_kits_current = db.tbl_eqpmt_kits_current.Find(currentEqpmtDelete.id);

            db.tbl_eqpmt_kits_current.Remove(tbl_eqpmt_kits_current);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteCustEqpmt(tbl_customer_eqpmt custEqpmtDelete)
        {
            tbl_customer_eqpmt tbl_customer_eqpmt = db.tbl_customer_eqpmt.Find(custEqpmtDelete.id);

            db.tbl_customer_eqpmt.Remove(tbl_customer_eqpmt);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #9
0
        public ActionResult DeleteEvent(tbl_event_type eventDelete)
        {
            tbl_event_type tbl_event_type = db.tbl_event_type.Find(eventDelete.id);

            db.tbl_event_type.Remove(tbl_event_type);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteCustomer(tbl_customer custDelete)
        {
            tbl_customer tbl_customer = db.tbl_customer.Find(custDelete.id);

            db.tbl_customer.Remove(tbl_customer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #11
0
 public ActionResult AddEvent(tbl_event_type eventAdd)
 {
     using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
     {
         entities.tbl_event_type.Add(new tbl_event_type()
         {
             eventID   = eventAdd.eventID,
             eventType = eventAdd.eventType
         });
         entities.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
 public ActionResult AddAvlblKit(tbl_eqpmt_kits_avlbl avlblKitAdd)
 {
     using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
     {
         entities.tbl_eqpmt_kits_avlbl.Add(new tbl_eqpmt_kits_avlbl()
         {
             eqpmtType = avlblKitAdd.eqpmtType,
             kitID     = avlblKitAdd.kitID
         });
         entities.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult UpdateAvlblKit(tbl_eqpmt_kits_avlbl avlblKitUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_eqpmt_kits_avlbl updatedAvlblKit = (from c in entities.tbl_eqpmt_kits_avlbl
                                                        where c.id == avlblKitUpdate.id
                                                        select c).FirstOrDefault();
                updatedAvlblKit.eqpmtType = avlblKitUpdate.eqpmtType;
                updatedAvlblKit.kitID     = avlblKitUpdate.kitID;
                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
예제 #14
0
        public ActionResult UpdateEqpmtType(tbl_eqpmt_type_mgmt eqpmtTypeUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_eqpmt_type_mgmt UpdatedEqpmtType = (from c in entities.tbl_eqpmt_type_mgmt
                                                        where c.id == eqpmtTypeUpdate.id
                                                        select c).FirstOrDefault();
                UpdatedEqpmtType.eqpmtType = eqpmtTypeUpdate.eqpmtType;

                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
예제 #15
0
        public ActionResult UpdateEvent(tbl_event_type eventUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_event_type updatedEvent = (from c in entities.tbl_event_type
                                               where c.id == eventUpdate.id
                                               select c).FirstOrDefault();
                updatedEvent.eventID   = eventUpdate.eventID;
                updatedEvent.eventType = eventUpdate.eventType;

                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
예제 #16
0
        public ActionResult UpdateEqpmt(tbl_eqpmt_type eqpmtUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_eqpmt_type updatedEqpmt = (from c in entities.tbl_eqpmt_type
                                               where c.id == eqpmtUpdate.id
                                               select c).FirstOrDefault();
                updatedEqpmt.eqpmtType   = eqpmtUpdate.eqpmtType;
                updatedEqpmt.model       = eqpmtUpdate.model;
                updatedEqpmt.description = eqpmtUpdate.description;
                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
 public ActionResult AddCustEqpmt(tbl_customer_eqpmt custEqpmtAdd)
 {
     using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
     {
         entities.tbl_customer_eqpmt.Add(new tbl_customer_eqpmt()
         {
             customerCode = custEqpmtAdd.customerCode,
             machineID    = custEqpmtAdd.machineID,
             jobNum       = custEqpmtAdd.jobNum,
             eqpmtType    = custEqpmtAdd.eqpmtType
         });
         entities.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult UpdateCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_eqpmt_kits_current UpdateCurrentEqpmt = (from c in entities.tbl_eqpmt_kits_current
                                                             where c.id == currentEqpmtUpdate.id
                                                             select c).FirstOrDefault();
                UpdateCurrentEqpmt.machineID = currentEqpmtUpdate.machineID;
                UpdateCurrentEqpmt.kitID     = currentEqpmtUpdate.kitID;

                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
예제 #19
0
        public ActionResult AddEqpmtType(tbl_eqpmt_type_mgmt eqpmtTypeAdd)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                entities.tbl_eqpmt_type_mgmt.Add(new tbl_eqpmt_type_mgmt
                {
                    eqpmtType = eqpmtTypeAdd.eqpmtType
                });


                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
 public ActionResult AddEvent(tbl_customer_event eventAdd)
 {
     using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
     {
         entities.tbl_customer_event.Add(new tbl_customer_event()
         {
             customerCode = eventAdd.customerCode,
             eventID      = eventAdd.eventID,
             eventType    = eventAdd.eventType,
             startDate    = eventAdd.startDate,
             endDate      = eventAdd.endDate
         });
         entities.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult AddCurrentEqpmt(tbl_eqpmt_kits_current currentEqpmtAdd)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                entities.tbl_eqpmt_kits_current.Add(new tbl_eqpmt_kits_current
                {
                    machineID = currentEqpmtAdd.machineID,
                    kitID     = currentEqpmtAdd.kitID
                });


                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
예제 #22
0
        public ActionResult UpdateKit(tbl_kit kitUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_kit updatedKit = (from c in entities.tbl_kit
                                      where c.id == kitUpdate.id
                                      select c).FirstOrDefault();
                updatedKit.kitID       = kitUpdate.kitID;
                updatedKit.description = kitUpdate.description;
                updatedKit.filePath    = kitUpdate.filePath;

                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
예제 #23
0
        public ActionResult AddEqpmt(tbl_eqpmt_type eqpmtAdd)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                entities.tbl_eqpmt_type.Add(new tbl_eqpmt_type
                {
                    eqpmtType   = eqpmtAdd.eqpmtType,
                    model       = eqpmtAdd.model,
                    description = eqpmtAdd.description
                });


                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult UpdateCustEqpmt(tbl_customer_eqpmt custEqpmtUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_customer_eqpmt updatedCustEqpmt = (from c in entities.tbl_customer_eqpmt
                                                       where c.id == custEqpmtUpdate.id
                                                       select c).FirstOrDefault();
                updatedCustEqpmt.customerCode = custEqpmtUpdate.customerCode;
                updatedCustEqpmt.machineID    = custEqpmtUpdate.machineID;
                updatedCustEqpmt.jobNum       = custEqpmtUpdate.jobNum;
                updatedCustEqpmt.eqpmtType    = custEqpmtUpdate.eqpmtType;

                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
예제 #25
0
        public ActionResult AddKit(tbl_kit kitAdd)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                entities.tbl_kit.Add(new tbl_kit
                {
                    kitID       = kitAdd.kitID,
                    description = kitAdd.description,
                    filePath    = kitAdd.filePath,
                });


                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
        public ActionResult UpdateEvent(tbl_customer_event eventUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_customer_event updatedEvent = (from c in entities.tbl_customer_event
                                                   where c.id == eventUpdate.id
                                                   select c).FirstOrDefault();
                updatedEvent.customerCode = eventUpdate.customerCode;
                updatedEvent.eventID      = eventUpdate.eventID;
                updatedEvent.eventType    = eventUpdate.eventType;
                updatedEvent.startDate    = eventUpdate.startDate;
                updatedEvent.endDate      = eventUpdate.endDate;

                entities.SaveChanges();
            }

            return(new EmptyResult());
        }
        public ActionResult UpdateCustomer(tbl_customer custUpdate)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                tbl_customer updatedCustomer = (from c in entities.tbl_customer
                                                where c.id == custUpdate.id
                                                select c).FirstOrDefault();
                updatedCustomer.customerCode = custUpdate.customerCode;
                updatedCustomer.name         = custUpdate.name;
                updatedCustomer.address      = custUpdate.address;
                updatedCustomer.city         = custUpdate.city;
                updatedCustomer.state        = custUpdate.state;
                updatedCustomer.zipCode      = custUpdate.zipCode;

                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult AddCustomer(tbl_customer customerAdd)
        {
            using (allpax_sale_minerEntities entities = new allpax_sale_minerEntities())
            {
                entities.tbl_customer.Add(new tbl_customer
                {
                    customerCode = customerAdd.customerCode,
                    name         = customerAdd.name,
                    address      = customerAdd.address,
                    city         = customerAdd.city,
                    state        = customerAdd.state,
                    zipCode      = customerAdd.zipCode,
                });


                entities.SaveChanges();
            }

            return(new EmptyResult());
        }