Ejemplo n.º 1
0
        public BizResult update(string user)
        {
            BizResult res = new BizResult();

            if (det1 == null)
            {
                throw new Exception("data is null");
            }

            if (updating_verify(res, user, det1))
            {
                det1.ScheduleDate = SafeValue_mb.DateTime_ClearTime(det1.ScheduleDate);
                det1.ScheduleTime = SafeValue_mb.convertTimeFormat(det1.ScheduleTime);
                det1.ServiceType  = (SafeValue.SafeString(det1.ServiceType).Equals("") ? default_ServiceType : det1.ServiceType);
                Manager.ORManager.StartTracking(det1, Wilson.ORMapper.InitialState.Updated);
                Manager.ORManager.PersistChanges(det1);
                res.status = true;

                //========== log container no changed
                C2.CtmJobEventLog elog = new C2.CtmJobEventLog();
                elog.Platform_isBackend();
                elog.Controller = user;
                if (oldv_containerNo != null && det1.ContainerNo != null && !oldv_containerNo.Equals(det1.ContainerNo))
                {
                    elog.setActionLevel(det1.Id, CtmJobEventLogRemark.Level.Container, -1, "ContainerNo[" + oldv_containerNo + "]->[" + det1.ContainerNo + "]");
                    elog.log();
                }

                updated_Status_changed(user);
                updated_to_trip();
                updated_to_house(user);

                resetOldValues();


                elog.setActionLevel(det1.Id, CtmJobEventLogRemark.Level.Container, 3);
                elog.log();
            }
            return(res);
        }
Ejemplo n.º 2
0
        public BizResult insert(string user, CtmJobDet1 par)
        {
            setData(null);
            if (par == null)
            {
                throw new Exception("data is null");
            }
            BizResult res = new BizResult();

            if (inserting_verify(res, user, par))
            {
                par.ScheduleDate      = SafeValue_mb.DateTime_ClearTime(par.ScheduleDate);
                par.ScheduleTime      = SafeValue_mb.convertTimeFormat(par.ScheduleTime);
                par.ScheduleStartDate = SafeValue_mb.DateTime_ClearTime(par.ScheduleStartDate);
                par.ServiceType       = (SafeValue.SafeString(par.ServiceType).Equals("") ? default_ServiceType : par.ServiceType);
                Manager.ORManager.StartTracking(par, Wilson.ORMapper.InitialState.Inserted);
                Manager.ORManager.PersistChanges(par);
                res.status = true;
                det1       = par;
                updated_Status_changed(user);

                resetOldValues();
                oldv_ServiceType = "";//==== update trips by service type.
                inserted_auto_CreateTrip(user);
                updated_to_trip();
                resetOldValues();


                C2.CtmJobEventLog elog = new C2.CtmJobEventLog();
                elog.Platform_isBackend();
                elog.Controller = user;
                elog.setActionLevel(det1.Id, CtmJobEventLogRemark.Level.Container, 1);
                elog.log();
            }
            return(res);
        }