示例#1
0
 public void Remove(VehicleObject vehicle)
 {
     try
     {
         CheckTransaction();
         new VehicleDataService(Transaction).Remove(vehicle);
         if (IsOwner)
         {
             Transaction.Commit();
         }
     }
     catch (Exception exception1)
     {
         if (IsOwner)
         {
             Transaction.Rollback();
         }
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (IsOwner)
         {
             Connection.Close();
         }
     }
 }
示例#2
0
        public bool Remove(VehicleObject vehicle)
        {
            SqlCommand cmd = null;

            try
            {
                ExecuteNonQuery(out cmd, false, "Vehicle_DELETE",
                                CreateParameter("@vehID", SqlDbType.UniqueIdentifier, vehicle.VehID, ParameterDirection.Input)
                                );
                return(true);
            }
            catch (Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Dispose();
                }
                cmd = null;
            }
        }
示例#3
0
        public void Save(VehicleObject vehicle)
        {
            SqlCommand cmd = null;

            try
            {
                ExecuteNonQuery(out cmd, false, "Vehicle_SAVE",
                                CreateParameter("@vehID", SqlDbType.UniqueIdentifier, vehicle.VehID, ParameterDirection.InputOutput),
                                CreateParameter("@transc_VehicleID", SqlDbType.Int, vehicle.Transc_VehicleID),
                                CreateParameter("@transc_VehicleType", SqlDbType.Int, vehicle.Transc_VehicleType),
                                CreateParameter("@Name", SqlDbType.NChar, vehicle.Name),
                                CreateParameter("@LicenseNumber", SqlDbType.NChar, vehicle.LicenseNumber),
                                CreateParameter("@Euronorm", SqlDbType.Int, vehicle.Euronorm),
                                CreateParameter("@Chassis", SqlDbType.NChar, vehicle.Chassis),
                                CreateParameter("@Brand", SqlDbType.NChar, vehicle.Brand),
                                CreateParameter("@Icon", SqlDbType.NChar, vehicle.Icon),
                                CreateParameter("@VehicleType", SqlDbType.VarChar, vehicle.VehicleType),
                                CreateParameter("@ContactTransics", SqlDbType.Bit, vehicle.ContactTransics)
                                );
                vehicle.VehID = (Guid)cmd.Parameters["@vehID"].Value;
            }
            catch (Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Dispose();
                }
                cmd = null;
            }
        }
示例#4
0
        public Material(PROF_IT.Common.Enumerations.TypeForm typeForm, VehicleObject vehicle)
        {
            try
            {
                InitializeComponent();

                _typeForm = typeForm;
                _material = new MaterialObject();
                if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
                {
                    Initialize();
                    louVehicle.EditValue = vehicle;
                    SetPermissions();
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
示例#5
0
        public AssignVehicle(VehicleObject vehicle)
        {
            InitializeComponent();

            this._vehicle        = vehicle;
            this.txtVehicle.Text = vehicle.Name;

            FillCboDispatcher();
        }
示例#6
0
        public MaterialObjectCollection GetByVehicle(VehicleObject vehicle)
        {
            MaterialObjectCollection materials;

            try
            {
                materials = new MaterialDataService().GetByVehicle(vehicle);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(materials);
        }
示例#7
0
        public MaintenanceVehicleObjectCollection GetByVehicleID(VehicleObject vehicle)
        {
            MaintenanceVehicleObjectCollection maintenanceVehicles;

            try
            {
                maintenanceVehicles = new MaintenanceVehicleDataService().GetByVehicleID(vehicle);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(maintenanceVehicles);
        }
示例#8
0
 private void gdvVehicle_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         GridView      view       = (GridView)sender;
         VehicleObject vehicleObj = (VehicleObject)view.GetRow(view.FocusedRowHandle);
         Vehicle       vehicle    = new Vehicle(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, vehicleObj);
         vehicle.ShowDialog();
     }
     catch (System.Exception excepion1)
     {
         System.Exception thisException = excepion1;
         Management.ShowException(thisException);
     }
 }
示例#9
0
        public VehicleMileageObjectCollection GetByVehicle(VehicleObject vehicle)
        {
            VehicleMileageObjectCollection vehicleMileages;

            try
            {
                vehicleMileages = new VehicleMileageDataService().GetByVehicle(vehicle);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(vehicleMileages);
        }
示例#10
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Vehicle"))
     {
         Debug.Log("Vechicle in range");
         manager.WeaponEnable(false);
         inRange    = true;
         Vehicle    = other.gameObject;
         vehicleObj = Vehicle.GetComponent <VehicleObject>();
         if (vehicleObj != null)
         {
             AttachPoint   = vehicleObj.AttachPoint;
             movementSpeed = vehicleObj.movementSpeed;
             rotationSpeed = vehicleObj.rotationSpeed;
         }
     }
 }
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedVehicle          = Vehicle;
             _loadedExecutor         = Executor;
             _loadedStartMaintenance = StartMaintenance;
             _loadedRemark           = Remark;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#12
0
        public MaintenanceVehicleObjectCollection GetByVehicleID(VehicleObject vehicle)
        {
            MaintenanceVehicleObjectCollection maintenanceVehicles = new MaintenanceVehicleObjectCollection();
            QueryBuilder builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendWhereString(MaintenanceVehicleObject.VEH_ID, vehicle.VehID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
                builder.Append("AND " + MaintenanceVehicleObject.VEH_ID + " is not null ");
                maintenanceVehicles = MaintenanceVehicleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(maintenanceVehicles);
        }
        public VehicleMileageObjectCollection GetByVehicle(VehicleObject vehicle)
        {
            VehicleMileageObjectCollection vehicleMileages = new VehicleMileageObjectCollection();
            QueryBuilder builder;

            try
            {
                if (vehicle.VehicleTransicsLink != null)
                {
                    builder = new QueryBuilder();
                    builder.Append(this.BaseQuery(false, 0));
                    builder.AppendWhereInteger(VehicleMileageObject.TRANSI_TNR_MAT, vehicle.VehicleTransicsLink.Transi_TNR_mat, QueryBuilder.ParameterLocation.FIRST_LAST);
                    builder.AppendOrderBy(VehicleMileageObject.DATE, QueryBuilder.OrderByType.DESC, QueryBuilder.ParameterLocation.FIRST_LAST);
                    vehicleMileages = VehicleMileageConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
                }
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(vehicleMileages);
        }
示例#14
0
        private void layoutView1_DoubleClick(object sender, EventArgs e)
        {
            int nIndex = layoutView1.FocusedRowHandle;

            if (nIndex < 0)
            {
                return;
            }
            CardTargetItem itemInfo   = mCardTargetList[nIndex];
            VehicleObject  vehicleObj = mVehicleObjList[nIndex];
            Rectangle      rect       = new Rectangle();

            string[] vehicleLocation = vehicleObj.vehicle.Clwz.Split(',');
            if (vehicleLocation.Length == 4)
            {
                rect.X      = Convert.ToInt32(vehicleLocation[0]);
                rect.Y      = Convert.ToInt32(vehicleLocation[1]);
                rect.Width  = Convert.ToInt32(vehicleLocation[2]);
                rect.Height = Convert.ToInt32(vehicleLocation[3]);
            }
            if (null == frmTargetDetial)
            {
                frmTargetDetial = new FrmTargetDetail();
            }
            else if (null != frmTargetDetial)
            {
                if (frmTargetDetial.IsDisposed)
                {
                    frmTargetDetial = new FrmTargetDetail();
                }
            }
            frmTargetDetial.SetImagePath(vehicleObj.ImagePath);
            //frmTargetDetial.SetTargetModel(targetInfoList[nIndex]);
            frmTargetDetial.SetDetailInfo(vehicleObj.ToString());
            frmTargetDetial.SetTargetRect(rect);
            frmTargetDetial.Show();
            frmTargetDetial.BringToFront();
        }
示例#15
0
 public Vehicle(PROF_IT.Common.Enumerations.TypeForm typeForm, VehicleObject vehicle)
 {
     try
     {
         InitializeComponent();
         _vehicle  = vehicle;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
             SetPermissions();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#16
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedMaterialCategory    = MaterialCategory;
             _loadedMaterialType        = MaterialType;
             _loadedMaterialSubType     = MaterialSubType;
             _loadedEmployeeCreator     = EmployeeCreator;
             _loadedEmployeeResponsable = EmployeeResponsable;
             _loadedVehicle             = Vehicle;
             _loadedSupplier            = Supplier;
             _loadedName                 = Name;
             _loadedDescription          = Description;
             _loadedType                 = Type;
             _loadedSerieNumber          = SerieNumber;
             _loadedInternalNumber       = InternalNumber;
             _loadedPurchasedOn          = PurchasedOn;
             _loadedPrice                = Price;
             _loadedNextMaintenance      = NextMaintenance;
             _loadedMaintenanceFrequency = MaintenanceFrequency;
             _loadedActive               = Active;
             _loadedBroken               = Broken;
             //Child members
             _loadedMemos        = Memos;
             _loadedMaintenances = Maintenances;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#17
0
 public new string ToString()
 {
     return(VehicleObject.ToString(AutoBody, EngineType));
 }
示例#18
0
        private void ReceiveMsg(Object threadContext)
        {
            ZError errors;
            int    threadIndex = (int)threadContext;

            Console.WriteLine("thread {0} ZmqFaceSink Start Receive Message !", threadIndex);
            while (receiving)
            {
                using (ZFrame frame = receiverSocketList[threadIndex].ReceiveFrame(ZSocketFlags.DontWait, out errors))
                {
                    if (null != frame)
                    {
                        // Process task
                        string        str           = System.Text.Encoding.UTF8.GetString(frame.Read());
                        List <string> mFileNameList = JsonConvert.DeserializeObject <List <string> >(str);
                        LogHelper.WriteLog(typeof(ZmqVehicleSink), "recv count " + mFileNameList.Count);
                        List <VehicleObject> mVehObjectList = new List <VehicleObject>();
                        foreach (var fileName in  mFileNameList)
                        {
                            using (var requester = new ZSocket(context, ZSocketType.REQ))
                            {
                                requester.Connect("tcp://127.0.0.1:50559");
                                string imagepath = fileName;
                                if (File.Exists(imagepath))
                                {
                                    Guid guid = Guid.NewGuid();
                                    DataTypes.VehicleInfo info = new DataTypes.VehicleInfo();
                                    info.Id        = "11111";
                                    info.Imagepath = (imagepath);
                                    info.Uuid      = guid.ToString().Replace("-", "");
                                    ZMessage zMsg = new ZMessage();
                                    zMsg.Add(new ZFrame(info.ToByteArray()));
                                    requester.Send(zMsg);
                                    using (ZFrame reply = requester.ReceiveFrame())
                                    {
                                        DataTypes.VehicleInfo msg2 = new DataTypes.VehicleInfo();
                                        msg2.MergeFrom(reply.Read());
                                        VehicleRecogResult vehicleResults = JsonConvert.DeserializeObject <VehicleRecogResult>(msg2.Jsonresult);
                                        if (null != vehicleResults.Veh)
                                        {
                                            foreach (var item in vehicleResults.Veh)
                                            {
                                                VehicleObject vehicleObj = new VehicleObject();
                                                string        FileName   = fileName;
                                                vehicleObj.ImagePath  = FileName;
                                                vehicleObj.TaskId     = "";
                                                vehicleObj.CreateTime = new BsonDateTime(DateTime.Now);
                                                vehicleObj.vehicle    = item;
                                                mVehObjectList.Add(vehicleObj);
                                            }
                                            //Console.WriteLine(" Received:  {0}!", msg2.Jsonresult);
                                        }
                                    }
                                }
                            }
                        }
                        if (mVehObjectList.Count > 0)
                        {
                            VehicleMongoDAL.GetInstance().AddVehicleObject(mVehObjectList);
                        }
                        Console.WriteLine("thread {0} receive count:{1}", threadIndex, mFileNameList.Count);
                    }
                    else
                    {
                        if (errors == ZError.ETERM)
                        {
                            return;     // Interrupted
                        }
                        if (errors != ZError.EAGAIN)
                        {
                            throw new ZException(errors);
                        }
                    }
                }
                Thread.Sleep(10);
            }
            Console.WriteLine("thread {0} ZmqVehicleSink End Receive Message !", threadIndex);
        }