Esempio n. 1
0
        public ActionResult RepairDescription()
        {
            //รับพารามิเตอร์
            int repairID = Int32.Parse(Request.Params["repID"]);

            RepairDetailModel rdModel = new RepairDetailModel();
            /////////////
            RepairModel rModel = new RepairModel();

            rModel.REPAIR_NO    = repairID;
            rModel.ALERT_STATUS = "0";  // หมายถึงดูแล้ว

            Database  db   = new Database();
            RepairDAO rDAO = new RepairDAO(db);

            rDAO.AlertStatus(rModel);
            db.Close();

            //////////////////////////
            db             = new Database();
            rDAO           = new RepairDAO(db);
            rdModel.REPAIR = rDAO.FindById(repairID);
            db.Close();

            db = new Database();
            RequisitionDAO rqDAO = new RequisitionDAO(db);

            rdModel.STOCK = rqDAO.FindByRepairID(rdModel.REPAIR.REPAIR_NO);
            db.Close();

            ViewData["Repair"] = rdModel;

            // รายการสถานะ
            db = new Database();
            RepStatusDAO          rtDAO   = new RepStatusDAO(db);
            List <RepStatusModel> rtModel = rtDAO.FindAll();

            ViewData["STATUS"] = rtModel;
            db.Close();

            db = new Database();
            RepairDAO   rpDAO   = new RepairDAO(db);
            RepairModel rpModel = rpDAO.FindById(repairID);

            db.Close();

            return(View());
        }
Esempio n. 2
0
        public ActionResult CustServiceDetail(int repID)
        {
            RepairDetailModel rdModel = new RepairDetailModel();
            /////////////
            RepairModel rModel = new RepairModel();

            rModel.REPAIR_NO    = repID;
            rModel.ALERT_STATUS = "1";  // หมายถึงดูแล้ว

            Database  db   = new Database();
            RepairDAO rDAO = new RepairDAO(db);

            rDAO.AlertStatus(rModel);
            db.Close();

            //////////////////////////
            db             = new Database();
            rDAO           = new RepairDAO(db);
            rdModel.REPAIR = rDAO.FindById(repID);
            db.Close();

            db = new Database();
            RequisitionDAO rqDAO = new RequisitionDAO(db);

            rdModel.STOCK = rqDAO.FindByRepairID(rdModel.REPAIR.REPAIR_NO);
            db.Close();

            ViewData["Repair"] = rdModel;

            // รายการสถานะ
            db = new Database();
            RepStatusDAO          rtDAO   = new RepStatusDAO(db);
            List <RepStatusModel> rtModel = rtDAO.FindAll();

            ViewData["STATUS"] = rtModel;
            db.Close();

            db = new Database();
            RepairDAO   rpDAO   = new RepairDAO(db);
            RepairModel rpModel = rpDAO.FindById(repID);

            db.Close();

            return(View());
        }