Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CarRepair carRepair = db.CarRepairs.Find(id);

            db.CarRepairs.Remove(carRepair);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 static CarAnalyzer()
 {
     CarRepair.AddType <CarObsoleteTyresRepair>();
     CarRepair.AddType <CarWeightRepair>();
     CarRepair.AddType <CarTorqueRepair>();
     CarRepair.AddType <CarWronglyTakenSoundRepair>();
     CarRepair.AddType <CarObsoleteSoundRepair>();
 }
Example #3
0
        private static ObsoleteDetails GetDetails(CarObject car, bool models, bool allowEmpty)
        {
            if (car.AcdData?.IsEmpty != false)
            {
                return(null);
            }

            var list = CarRepair.GetObsoletableAspects(car, models).ToList();

            return(allowEmpty || list.Count > 0 ? new ObsoleteDetails(car, list) : null);
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "RepairId,RepairName,Notes,CarId,EmployeeId")] CarRepair carRepair)
 {
     if (ModelState.IsValid)
     {
         db.Entry(carRepair).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CarId      = new SelectList(db.Cars, "CarId", "Manufacturer", carRepair.CarId);
     ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "Name", carRepair.EmployeeId);
     return(View(carRepair));
 }
Example #5
0
        // GET: CarRepairs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CarRepair carRepair = db.CarRepairs.Find(id);

            if (carRepair == null)
            {
                return(HttpNotFound());
            }
            return(View(carRepair));
        }
Example #6
0
        /// <summary>
        /// 监测车辆报修数据
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public void SaveToCarRepair(Action <string, eOutputType> output)
        {
            //查询全部在途车辆
            List <CMCSTBBUYFUELTRANSPORT> list = this.SelfDber.Entities <CMCSTBBUYFUELTRANSPORT>("where ISFINISH = 0 and STEPNAME = '在途' order by STARTTIME desc", null);

            foreach (var item in list)
            {
                CarRepair entity = SelfDber.Entity <CarRepair>(string.Format(" where CARID='{0}' and REPAIRSTATUS=0", item.AUTOTRUCKID));
                if (entity != null)
                {
                    item.ISREPAIRERR = 1;
                    this.SelfDber.Update(item);
                }
            }
        }
Example #7
0
        // GET: CarRepairs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CarRepair carRepair = db.CarRepairs.Find(id);

            if (carRepair == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CarId      = new SelectList(db.Cars, "CarId", "Manufacturer", carRepair.CarId);
            ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "Name", carRepair.EmployeeId);
            return(View(carRepair));
        }
Example #8
0
        public override ActionResult Update(GoodsOut entity)
        {
            ActionResult r = base.Update(entity);

            //更新同步信息
            //汽修
            CarRepair cr = this.service.CarRepair.Query().Where(m => m.GoodsOutID == entity.ID).FirstOrDefault();

            if (cr != null)
            {
                cr.CarMan       = entity.OutMan;
                cr.RepairMan    = entity.OutMan;
                cr.RepairReason = entity.OutReason;
                cr.RepairDes    = entity.OutReason;
                this.service.CarRepair.Update(cr);
            }
            //设备维修
            EquipMtLy em = this.service.EquipMtLyService.Query().Where(m => m.GoodsOutID == entity.ID).FirstOrDefault();

            if (em != null)
            {
                em.Finder     = entity.OutMan;
                em.FindTime   = entity.OutTime;
                em.ApplyMan   = entity.OutMan;
                em.ApplyTime  = entity.OutTime;
                em.TroubleDes = entity.OutReason;
                this.service.EquipMtLyService.Update(em);
                //子项
                EquipMtLyItem item = this.service.EquipMtLyItem.Query().Where(m => m.EquipMtLyID == em.ID).FirstOrDefault();
                item.DepartmentID = entity.DepartmentID;
                item.Remark       = entity.Remark;
                item.Amount       = Convert.ToInt32(entity.OutNum);
                this.service.EquipMtLyItem.Update(item);
            }


            ThreadID tid = new ThreadID();

            tid.currentDate = entity.OutTime;
            tid.typeID      = entity.GoodsID; //辅材id
            tid.typename    = "1";            //辅材
            this.service.ThreadID.Add(tid);


            return(r);
        }
        /// <summary>
        /// 领导审核
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Auditing2(PurchasePlanByEquip entity)
        {
            int?id = entity.ID;
            PurchasePlanByEquip obj = this.m_ServiceBase.Get(id);

            if (obj == null)
            {
                return(OperateResult(true, Lang.Msg_Operate_Failed, null));
            }
            obj.PurchasePlan_state         = entity.PurchasePlan_state;
            obj.PurchasePlan_audit_opinion = entity.PurchasePlan_audit_opinion;
            //更新阶段
            if (obj.PurchasePlan_state == 3)
            {
                //通过
                obj.PurchasePlan_planstate     = 2;
                obj.PurchasePlan_audit_date    = DateTime.Now;
                obj.PurchasePlan_audit_opinion = entity.PurchasePlan_audit_opinion;
                obj.PurchasePlan_auditor       = AuthorizationService.CurrentUserID;

                return(base.Update(obj));
            }
            else
            {
                //维修申请改成未提交
                if (obj._type == 0)
                {
                    string    EquipMtLyID = obj.EquipMtLyID;
                    EquipMtLy op          = this.service.EquipMtLyService.Get(EquipMtLyID);
                    op.mtlystate = 0;
                    this.service.EquipMtLyService.Update(op);
                }
                else
                {
                    string    EquipMtLyID = obj.EquipMtLyID;
                    CarRepair op          = this.service.CarRepair.Get(EquipMtLyID);
                    op.mtlystate = 0;
                    this.service.CarRepair.Update(op);
                }

                //删除申请记录
                return(this.Delete(new int[] { Convert.ToInt32(obj.ID) }));
            }
        }
Example #10
0
        public ActionResult AddM(string outID, string MC, string ME, string carid, string name)
        {
            if (string.IsNullOrEmpty(outID))
            {
                return(OperateResult(false, "物资领用ID为空", ""));
            }
            GoodsOut gout = this.service.GoodsOut.Get(outID);

            //领用同步值
            int M = 0;

            if (MC == "true" && ME == "true")
            {
                M = 3;
            }
            else if (MC == "true")
            {
                M = 1;
            }
            else if (ME == "true")
            {
                M = 2;
            }
            gout.IsR = M;
            this.Update(gout);

            if (MC == "true")
            {
                //汽修
                CarRepair cr = new CarRepair();
                cr.CarMan       = gout.OutMan;
                cr.CarID        = carid;
                cr.RepairType   = "修理";
                cr.RepairTime   = gout.OutTime; //DateTime.Now;
                cr.RepairAddr   = "";
                cr.RepairMan    = gout.OutMan;
                cr.RepairReason = gout.OutReason;
                cr.RepairDes    = gout.GoodsName + gout.OutNum + "个";
                cr.RepairCost   = gout.price * gout.OutNum;
                cr.mtlystate    = 0;
                cr.summoney     = 0m;
                cr.GoodsOutID   = outID;
                cr.CarMan       = name;
                this.service.CarRepair.Add(cr);
            }

            if (ME == "true")
            {
                //设备修
                EquipMtLy em = new EquipMtLy();
                em.MtDate     = DateTime.Now;
                em.IsEntrust  = false;
                em.Finder     = gout.OutMan;
                em.FindTime   = gout.OutTime;
                em.ApplyMan   = gout.OutMan;
                em.ApplyTime  = gout.OutTime;
                em.TroubleDes = gout.OutReason;
                em.RepairAdv  = "";
                em.mtlystate  = 0;
                em.GoodsOutID = outID;
                this.service.EquipMtLyService.Add(em);
                //子项
                EquipMtLyItem item = new EquipMtLyItem();
                item.EquipMtLyID  = em.ID;
                item.DepartmentID = gout.DepartmentID;
                item.UserID       = User.UserID();
                //item.IsAssess = false;
                item.Remark = gout.Remark;
                item.Amount = Convert.ToInt32(gout.OutNum);
                this.service.EquipMtLyItem.Add(item);
            }



            return(OperateResult(true, Lang.Msg_Operate_Success, ""));
        }
Example #11
0
 static MigrationHelper()
 {
     CarRepair.AddType <CarObsoleteTyresRepair>();
 }