Esempio n. 1
0
        public static void Update(VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCBE hardware)
        {
            try
            {
                string    spName  = VaaaN.MLFF.Libraries.CommonLibrary.Constants.oraclePackagePrefix + "HARDWARE_UPDATE";
                DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);

                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TMS_ID", DbType.Int32, hardware.TMSId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_PLAZA_ID", DbType.Int32, hardware.PlazaId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_HARDWARE_ID", DbType.Int32, hardware.HardwareId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_HARDWARE_NAME", DbType.String, hardware.HardwareName, ParameterDirection.Input, 50));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_HARDWARE_TYPE", DbType.Int32, hardware.HardwareType, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_HARDWARE_POSITION", DbType.Int32, hardware.HardwarePosition, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_MANUFACTURER_NAME", DbType.String, hardware.ManufacturerName, ParameterDirection.Input, 100));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_MODEL_NAME", DbType.String, hardware.ModelName, ParameterDirection.Input, 100));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_IP_ADDRESS", DbType.String, hardware.IpAddress, ParameterDirection.Input, 20));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_MODIFIED_BY", DbType.Int32, hardware.ModifierId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_MODIFICATION_DATE", DbType.DateTime, hardware.ModificationDate, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TRANSFER_STATUS", DbType.Int32, hardware.TransferStatus, ParameterDirection.Input));
                VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.ExecuteNonQuery(command);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
 public static void Update(VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCBE hardware)
 {
     VaaaN.MLFF.Libraries.CommonLibrary.DAL.HardwareDAL.Update(hardware);
 }
Esempio n. 3
0
        private static VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCollection ConvertDataTableToCollection(DataTable dt)
        {
            try
            {
                VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCollection hardwareCollection = new VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCollection();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCBE hardware = new VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCBE();

                    if (dt.Rows[i]["TMS_ID"] != DBNull.Value)
                    {
                        hardware.TMSId = Convert.ToInt32(dt.Rows[i]["TMS_ID"]);
                    }

                    if (dt.Rows[i]["PLAZA_ID"] != DBNull.Value)
                    {
                        hardware.PlazaId = Convert.ToInt32(dt.Rows[i]["PLAZA_ID"]);
                    }

                    if (dt.Rows[i]["HARDWARE_ID"] != DBNull.Value)
                    {
                        hardware.HardwareId = Convert.ToInt32(dt.Rows[i]["HARDWARE_ID"]);
                    }

                    if (dt.Rows[i]["HARDWARE_NAME"] != DBNull.Value)
                    {
                        hardware.HardwareName = Convert.ToString(dt.Rows[i]["HARDWARE_NAME"]);
                    }

                    if (dt.Rows[i]["HARDWARE_TYPE"] != DBNull.Value)
                    {
                        hardware.HardwareType = Convert.ToInt32(dt.Rows[i]["HARDWARE_TYPE"]);
                    }
                    hardware.HardwareTypeName = GetEnumFieldName(typeof(VaaaN.MLFF.Libraries.CommonLibrary.Constants.HardwareType), VaaaN.MLFF.Libraries.CommonLibrary.Constants.HardwareTypeName, hardware.HardwareType - 1);

                    if (dt.Rows[i]["HARDWARE_POSITION"] != DBNull.Value)
                    {
                        hardware.HardwarePosition = Convert.ToInt32(dt.Rows[i]["HARDWARE_POSITION"]);
                    }

                    if (dt.Rows[i]["MANUFACTURER_NAME"] != DBNull.Value)
                    {
                        hardware.ManufacturerName = Convert.ToString(dt.Rows[i]["MANUFACTURER_NAME"]);
                    }

                    if (dt.Rows[i]["MODEL_NAME"] != DBNull.Value)
                    {
                        hardware.ModelName = Convert.ToString(dt.Rows[i]["MODEL_NAME"]);
                    }

                    if (dt.Rows[i]["IP_ADDRESS"] != DBNull.Value)
                    {
                        hardware.IpAddress = Convert.ToString(dt.Rows[i]["IP_ADDRESS"]);
                    }

                    if (dt.Rows[i]["CREATION_DATE"] != DBNull.Value)
                    {
                        hardware.CreationDate = Convert.ToDateTime(dt.Rows[i]["CREATION_DATE"]);
                    }

                    if (dt.Rows[i]["MODIFICATION_DATE"] != DBNull.Value)
                    {
                        hardware.ModificationDate = Convert.ToDateTime(dt.Rows[i]["MODIFICATION_DATE"]);
                    }

                    if (dt.Rows[i]["MODIFIED_BY"] != DBNull.Value)
                    {
                        hardware.ModifierId = Convert.ToInt32(dt.Rows[i]["MODIFIED_BY"]);
                    }

                    if (dt.Rows[i]["TRANSFER_STATUS"] != DBNull.Value)
                    {
                        hardware.TransferStatus = Convert.ToInt32(dt.Rows[i]["TRANSFER_STATUS"]);
                    }

                    hardwareCollection.Add(hardware);
                }
                return(hardwareCollection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
 public static int Insert(VaaaN.MLFF.Libraries.CommonLibrary.CBE.HardwareCBE hardware)
 {
     return(VaaaN.MLFF.Libraries.CommonLibrary.DAL.HardwareDAL.Insert(hardware));
 }