public static DCDevice GetDCDevicesById(int DCDeviceID)
        {
            DataRow DCDevicesRow = DCDeviceDataAccess.GetInstance.GetDCDevicesById(DCDeviceID);

            DCDevice TheDCDeviceRow = DataRowToObject(DCDevicesRow);

            return(TheDCDeviceRow);
        }
        public int DeleteDCDevices(DCDevice theDCDevice)
        {
            int ReturnValue = 0;

            using (SqlCommand DeleteCommand = new SqlCommand())
            {
                DeleteCommand.CommandType = CommandType.StoredProcedure;
                DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                DeleteCommand.Parameters.Add(GetParameter("@DCDeviceID", SqlDbType.Int, theDCDevice.DCDeviceID));
                DeleteCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                DeleteCommand.CommandText = "pCRM_DCDevices_Delete";
                ExecuteStoredProcedure(DeleteCommand);
                ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());
                return(ReturnValue);
            }
        }
        public static List <DCDevice> GetDCDeviceList(bool allOffices = false, bool showDeleted = false)
        {
            List <DCDevice> DCDeviceList = new List <DCDevice>();

            DataTable DCDeviceTable = new DataTable();

            DCDeviceTable = DCDeviceDataAccess.GetInstance.GetDCDeviceList(allOffices, showDeleted);

            foreach (DataRow dr in DCDeviceTable.Rows)
            {
                DCDevice TheDCDevice = DataRowToObject(dr);

                DCDeviceList.Add(TheDCDevice);
            }
            return(DCDeviceList);
        }
        public static DCDevice DataRowToObject(DataRow dr)
        {
            DCDevice TheDCDevice = new DCDevice();

            TheDCDevice.DCCollectorID        = int.Parse(MicroGlobals.ReturnZeroIfNull(dr["DCCollectorID"].ToString()));
            TheDCDevice.DCDeviceID           = int.Parse(dr["DCDeviceID"].ToString());
            TheDCDevice.DCDeviceCode         = dr["DCDeviceCode"].ToString();
            TheDCDevice.DCDeviceSerialNumber = dr["DCDeviceSerialNumber"].ToString();
            TheDCDevice.DCCollectorCode      = dr["DCCollectorCode"].ToString();
            TheDCDevice.DCCollectorName      = dr["DCCollectorName"].ToString();
            TheDCDevice.AddedBy    = int.Parse(dr["AddedBy"].ToString());
            TheDCDevice.OfficeID   = int.Parse(dr["OfficeID"].ToString());
            TheDCDevice.OfficeName = dr["OfficeName"].ToString();
            TheDCDevice.DateAdded  = DateTime.Parse(dr["DateAdded"].ToString()).ToString(MicroConstants.DateFormat);

            return(TheDCDevice);
        }
        public int InsertDCDevices(DCDevice theDCDevice)
        {
            int ReturnValue = 0;

            using (SqlCommand InsertCommand = new SqlCommand())
            {
                InsertCommand.CommandType = CommandType.StoredProcedure;
                InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                InsertCommand.Parameters.Add(GetParameter("@DCDeviceSerialNumber", SqlDbType.VarChar, theDCDevice.DCDeviceSerialNumber));
                InsertCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID));
                InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                InsertCommand.CommandText = "pCRM_DCDevices_Insert";
                ExecuteStoredProcedure(InsertCommand);
                ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString());
                return(ReturnValue);
            }
        }
 public static int DeleteDCDevices(DCDevice theDCDevice)
 {
     return(DCDeviceDataAccess.GetInstance.DeleteDCDevices(theDCDevice));
 }
 public static int InsertDCDevices(DCDevice theDCDevice)
 {
     return(DCDeviceDataAccess.GetInstance.InsertDCDevices(theDCDevice));
 }
Example #8
0
 public int DeleteDCDevices(DCDevice theDCDevice)
 {
     return(DCDeviceIntegration.DeleteDCDevices(theDCDevice));
 }
Example #9
0
 public int UpdateDCDevices(DCDevice theDCDevice)
 {
     return(DCDeviceIntegration.UpdateDCDevices(theDCDevice));
 }
Example #10
0
 public int InsertDCDevices(DCDevice theDCDevice)
 {
     return(DCDeviceIntegration.InsertDCDevices(theDCDevice));
 }