void IInjectorManager.ModifyInjector(
            IInjectorStorage pStorage,
            Injector pInjector)
        {
            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pInjector, "pInjector");

                Verify.ArgumentNotNull(
                    pInjector.InjectorName,
                    "pInjector.InjectorName");



                Verify.ArgumentNotSpecified(
                    (pInjector.InjectorName.Length == 0),
                    "pInjector.InjectorName");

                #endregion

                pStorage.UpdateInjector(pInjector);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }
        }
        Manufacturers IManufacturersManager.ReadManufacturers(
            IManufacturersStorage pStorage,
            int pManufacturersID)
        {
            Manufacturers response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pStorage, "pStorage");
                Verify.ArgumentNotSpecified(
                    pManufacturersID <= 0,
                    "pManufacturersID");
                #endregion

                response =
                    pStorage.ReadManufacturers(pManufacturersID);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
        Injector IInjectorManager.CreateInjector(
            IInjectorStorage pStorage,
            Injector pInjector)
        {
            Injector response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pInjector, "pInjector");

                Verify.ArgumentNotNull(
                    pInjector.InjectorName,
                    "pInjector.InjectorName");

                Verify.ArgumentNotSpecified(
                    (pInjector.InjectorName.Length == 0),
                    "pInjector.InjectorName");

                #endregion

                response = pStorage.CreateInjector(pInjector);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
Example #4
0
        InjectionMessage IInjectionMessageManager.ReadInjectionMessage(
            IInjectionMessageStorage pStorage,
            int pInjectionMessageID)
        {
            InjectionMessage response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pStorage, "pStorage");
                Verify.ArgumentNotSpecified(
                    pInjectionMessageID <= 0,
                    "pInjectionMessageID");
                #endregion

                response =
                    pStorage.ReadInjectionMessage(pInjectionMessageID);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
Example #5
0
        Vaccine IVaccineManager.ReadVaccine(
            IVaccineStorage pStorage,
            int pVaccineID)
        {
            Vaccine response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pStorage, "pStorage");
                Verify.ArgumentNotSpecified(
                    pVaccineID <= 0,
                    "pVaccineID");
                #endregion

                response =
                    pStorage.ReadVaccine(pVaccineID);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
        ManagerUser IManagerUserManager.ReadManagerUser(
            IManagerUserStorage pStorage,
            int pUserID)
        {
            ManagerUser response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pStorage, "pStorage");
                Verify.ArgumentNotSpecified(
                    pUserID <= 0,
                    "pUserID");
                #endregion

                response =
                    pStorage.ReadManagerUser(pUserID);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
        ManagerUserPicture IManagerUserPictureManager.CreateManagerUserPicture(
            IManagerUserPictureStorage pStorage,
            ManagerUserPicture pManagerUserPicture)
        {
            ManagerUserPicture response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pManagerUserPicture, "pManagerUserPicture");

                Verify.ArgumentNotSpecified(
                    (pManagerUserPicture.UserID <= 0),
                    "pManagerUserPicture.UserID");

                #endregion

                response = pStorage.CreateManagerUserPicture(pManagerUserPicture);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
Example #8
0
        InjectionMessage IInjectionMessageManager.CreateInjectionMessage(
            IInjectionMessageStorage pStorage,
            InjectionMessage pInjectionMessage)
        {
            InjectionMessage response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pInjectionMessage, "pInjectionMessage");

                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectorID,
                    "pInjectionMessage.InjectorID");

                Verify.ArgumentNotNull(
                    pInjectionMessage.VaccineID,
                    "pInjectionMessage.VaccineID");

                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectionMessageSite,
                    "pInjectionMessage.InjectionMessageSite");


                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectionMessageDoctor,
                    "pInjectionMessage.InjectionMessageDoctor");



                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectorID <= 0),
                    "pInjectionMessage.InjectorID");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.VaccineID <= 0),
                    "pInjectionMessage.VaccineID");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectionMessageSite.Length == 0),
                    "pInjectionMessage.InjectionMessageSite");


                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectionMessageDoctor.Length == 0),
                    "pInjectionMessage.InjectionMessageDoctor");

                #endregion

                response = pStorage.CreateInjectionMessage(pInjectionMessage);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
Example #9
0
        void IInjectionMessageManager.ModifyInjectionMessage(
            IInjectionMessageStorage pStorage,
            InjectionMessage pInjectionMessage)
        {
            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pInjectionMessage, "pInjectionMessage");

                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectorID,
                    "pInjectionMessage.InjectorID");

                Verify.ArgumentNotNull(
                    pInjectionMessage.VaccineID,
                    "pInjectionMessage.VaccineID");

                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectionMessageSite,
                    "pInjectionMessage.InjectionMessageSite");


                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectionMessageDoctor,
                    "pInjectionMessage.InjectionMessageDoctor");



                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectorID <= 0),
                    "pInjectionMessage.InjectorID");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.VaccineID <= 0),
                    "pInjectionMessage.VaccineID");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectionMessageSite.Length == 0),
                    "pInjectionMessage.InjectionMessageSite");


                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectionMessageDoctor.Length == 0),
                    "pInjectionMessage.InjectionMessageDoctor");

                #endregion

                pStorage.UpdateInjectionMessage(pInjectionMessage);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }
        }
Example #10
0
        Vaccine IVaccineManager.CreateVaccine(
            IVaccineStorage pStorage,
            Vaccine pVaccine)
        {
            Vaccine response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pVaccine, "pVaccine");

                Verify.ArgumentNotNull(
                    pVaccine.VaccineName,
                    "pVaccine.VaccineName");

                Verify.ArgumentNotNull(
                    pVaccine.ManufacturersID,
                    "pVaccine.ManufacturersID");


                Verify.ArgumentNotSpecified(
                    (pVaccine.VaccineName.Length == 0),
                    "pVaccine.VaccineName");

                Verify.ArgumentNotSpecified(
                    (pVaccine.ManufacturersID <= 0),
                    "pVaccine.ManufacturersID");

                #endregion

                response = pStorage.CreateVaccine(pVaccine);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
        Manufacturers IManufacturersManager.CreateManufacturers(
            IManufacturersStorage pStorage,
            Manufacturers pManufacturers)
        {
            Manufacturers response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pManufacturers, "pManufacturers");

                Verify.ArgumentNotNull(
                    pManufacturers.ManufacturersName,
                    "pManufacturers.ManufacturersName");

                Verify.ArgumentNotNull(
                    pManufacturers.ManufacturersSite,
                    "pManufacturers.ManufacturersSite");


                Verify.ArgumentNotSpecified(
                    (pManufacturers.ManufacturersName.Length == 0),
                    "pManufacturers.ManufacturersName");

                Verify.ArgumentNotSpecified(
                    (pManufacturers.ManufacturersSite.Length == 0),
                    "pManufacturers.ManufacturersSite");

                #endregion

                response = pStorage.CreateManufacturers(pManufacturers);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
        ManagerUser IManagerUserManager.CreateManagerUser(
            IManagerUserStorage pStorage,
            ManagerUser pManagerUser)
        {
            ManagerUser response = null;

            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pManagerUser, "pManagerUser");

                Verify.ArgumentNotNull(
                    pManagerUser.UserName,
                    "pManagerUser.UserName");

                Verify.ArgumentNotNull(
                    pManagerUser.UserPassword,
                    "pManagerUser.UserPassword");


                Verify.ArgumentNotSpecified(
                    (pManagerUser.UserName.Length == 0),
                    "pManagerUser.UserName");

                Verify.ArgumentNotSpecified(
                    (pManagerUser.UserPassword.Length == 0),
                    "pManagerUser.UserPassword");

                #endregion

                response = pStorage.CreateManagerUser(pManagerUser);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }

            return(response);
        }
Example #13
0
        void IVaccineManager.ModifyVaccine(
            IVaccineStorage pStorage,
            Vaccine pVaccine)
        {
            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pVaccine, "pVaccine");

                Verify.ArgumentNotNull(
                    pVaccine.VaccineName,
                    "pVaccine.VaccineName");

                Verify.ArgumentNotNull(
                    pVaccine.ManufacturersID,
                    "pVaccine.ManufacturersID");


                Verify.ArgumentNotSpecified(
                    (pVaccine.VaccineName.Length == 0),
                    "pVaccine.VaccineName");

                Verify.ArgumentNotSpecified(
                    (pVaccine.ManufacturersID <= 0),
                    "pVaccine.ManufacturersID");

                #endregion

                pStorage.UpdateVaccine(pVaccine);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }
        }
        void IManagerUserManager.ModifyManagerUser(
            IManagerUserStorage pStorage,
            ManagerUser pManagerUser)
        {
            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pManagerUser, "pManagerUser");

                Verify.ArgumentNotNull(
                    pManagerUser.UserName,
                    "pManagerUser.UserName");

                Verify.ArgumentNotNull(
                    pManagerUser.UserPassword,
                    "pManagerUser.UserPassword");


                Verify.ArgumentNotSpecified(
                    (pManagerUser.UserName.Length == 0),
                    "pManagerUser.UserName");

                Verify.ArgumentNotSpecified(
                    (pManagerUser.UserPassword.Length == 0),
                    "pManagerUser.UserPassword");

                #endregion

                pStorage.UpdateManagerUser(pManagerUser);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }
        }
        void IManufacturersManager.ModifyManufacturers(
            IManufacturersStorage pStorage,
            Manufacturers pManufacturers)
        {
            try
            {
                #region Verify argument

                Verify.ArgumentNotNull(pManufacturers, "pManufacturers");

                Verify.ArgumentNotNull(
                    pManufacturers.ManufacturersName,
                    "pManufacturers.ManufacturersName");

                Verify.ArgumentNotNull(
                    pManufacturers.ManufacturersSite,
                    "pManufacturers.ManufacturersSite");


                Verify.ArgumentNotSpecified(
                    (pManufacturers.ManufacturersName.Length == 0),
                    "pManufacturers.ManufacturersName");

                Verify.ArgumentNotSpecified(
                    (pManufacturers.ManufacturersSite.Length == 0),
                    "pManufacturers.ManufacturersSite");

                #endregion

                pStorage.UpdateManufacturers(pManufacturers);
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
            }
        }
Example #16
0
        InjectionMessage IInjectionMessageStorage.CreateInjectionMessage(
            InjectionMessage pInjectionMessage)
        {
            SqlConnection conn = null;

            try
            {
                Verify.ArgumentNotNull(pInjectionMessage, "pInjectionMessage");

                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectionMessageSite,
                    "pInjectionMessage.InjectionMessageSite");

                Verify.ArgumentNotNull(
                    pInjectionMessage.InjectionMessageDoctor,
                    "pInjectionMessage.InjectionMessageDoctor");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectorID <= 0),
                    "pInjectionMessage.InjectorID");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.VaccineID <= 0),
                    "pInjectionMessage.VaccineID");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectionMessageSite.Length == 0),
                    "pInjectionMessage.InjectionMessageSite");

                Verify.ArgumentNotSpecified(
                    (pInjectionMessage.InjectionMessageDoctor.Length == 0),
                    "pInjectionMessage.InjectionMessageDoctor");


                int?newInjectionMessageId;

                conn = new SqlConnection(
                    ConfigurationManager
                    .ConnectionStrings["DEFAULT"].ToString());

                conn.Open();

                int recordsAffected = InjectionMessageCreateWrapper.ExecuteNonQuery(
                    conn,
                    pInjectionMessage.InjectorID,
                    pInjectionMessage.InjectorName,
                    pInjectionMessage.VaccineID,
                    pInjectionMessage.VaccineName,
                    pInjectionMessage.InjectionMessageSite,
                    pInjectionMessage.InjectionMessageTime,
                    pInjectionMessage.InjectionMessageDoctor,
                    out newInjectionMessageId);

                pInjectionMessage.InjectionMessageID = Convert.ToInt32(newInjectionMessageId);


                conn.Close();

                if (recordsAffected == 0)
                {
                    throw new Exception("InjectionMessage create failure!");
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
                //switch (ex.GetType().FullName)
                //{
                //    case "System.ArgumentNullException":
                //        {
                //            throw new ArgumentNullException(ex.Message);
                //        }
                //    case "System.ArgumentException":
                //        {
                //            throw new ArgumentException(ex.Message);
                //        }
                //    default:
                //        throw new Exception(ex.Message);
                //}
            }
            #region Dispose

            finally
            {
                if (conn != null)
                {
                    conn.Dispose();
                }
            }

            #endregion

            return(pInjectionMessage);
        }
        void IManufacturersStorage.UpdateManufacturers(Manufacturers pManufacturers)
        {
            SqlConnection conn = null;

            try
            {
                Verify.ArgumentNotNull(pManufacturers, "pManufacturers");

                Verify.ArgumentNotSpecified(
                    pManufacturers.ManufacturersID <= 0,
                    "pManufacturers.ManufacturersID");

                Verify.ArgumentNotNull(
                    pManufacturers.ManufacturersName,
                    "pManufacturers.ManufacturersName");

                Verify.ArgumentNotNull(
                    pManufacturers.ManufacturersSite,
                    "pManufacturers.ManufacturersSite");


                Verify.ArgumentNotSpecified(
                    pManufacturers.ManufacturersName.Length == 0,
                    "pManufacturers.ManufacturersName");

                Verify.ArgumentNotSpecified(
                    pManufacturers.ManufacturersSite.Length == 0,
                    "pManufacturers.ManufacturersSite");


                conn = new SqlConnection(
                    ConfigurationManager
                    .ConnectionStrings["DEFAULT"].ToString());

                conn.Open();

                int recordsAffected = ManufacturersByManufacturersIdUpdateWrapper
                                      .ExecuteNonQuery(
                    conn,
                    pManufacturers.ManufacturersID,
                    pManufacturers.ManufacturersName,
                    pManufacturers.ManufacturersSite,
                    pManufacturers.ManufacturersPhone,
                    pManufacturers.ManufacturersDom,
                    pManufacturers.ManufacturersDoe);


                conn.Close();

                if (recordsAffected == 0)
                {
                    throw new Exception("Manufacturers update failure!");
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
                //switch (ex.GetType().FullName)
                //{
                //    case "System.ArgumentNullException":
                //        {
                //            throw new ArgumentNullException(ex.Message);
                //        }
                //    case "System.ArgumentException":
                //        {
                //            throw new ArgumentException(ex.Message);
                //        }
                //    default:
                //        throw new Exception(ex.Message);
                //}
            }
            #region Dispose

            finally
            {
                if (conn != null)
                {
                    conn.Dispose();
                }
            }

            #endregion
        }
        void IInjectorStorage.UpdateInjector(Injector pInjector)
        {
            SqlConnection conn = null;

            try
            {
                Verify.ArgumentNotNull(pInjector, "pInjector");

                Verify.ArgumentNotSpecified(
                    pInjector.InjectorID <= 0,
                    "pInjector.InjectorID");

                Verify.ArgumentNotNull(
                    pInjector.InjectorName,
                    "pInjector.InjectorName");

                Verify.ArgumentNotSpecified(
                    pInjector.InjectorName.Length == 0,
                    "pInjector.InjectorName");


                conn = new SqlConnection(
                    ConfigurationManager
                    .ConnectionStrings["DEFAULT"].ToString());

                conn.Open();

                int recordsAffected = InjectorByInjectorIdUpdateWrapper
                                      .ExecuteNonQuery(
                    conn,
                    pInjector.InjectorID,
                    pInjector.InjectorName,
                    pInjector.InjectorSex,
                    pInjector.InjectorPhone,
                    pInjector.InjectorNumber,
                    pInjector.InjectorTime);


                conn.Close();

                if (recordsAffected == 0)
                {
                    throw new Exception("Injector update failure!");
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
                //switch (ex.GetType().FullName)
                //{
                //    case "System.ArgumentNullException":
                //        {
                //            throw new ArgumentNullException(ex.Message);
                //        }
                //    case "System.ArgumentException":
                //        {
                //            throw new ArgumentException(ex.Message);
                //        }
                //    default:
                //        throw new Exception(ex.Message);
                //}
            }
            #region Dispose

            finally
            {
                if (conn != null)
                {
                    conn.Dispose();
                }
            }

            #endregion
        }
        void IVaccineStorage.UpdateVaccine(Vaccine pVaccine)
        {
            SqlConnection conn = null;

            try
            {
                Verify.ArgumentNotNull(pVaccine, "pVaccine");

                Verify.ArgumentNotSpecified(
                    pVaccine.VaccineID <= 0,
                    "pVaccine.VaccineID");

                Verify.ArgumentNotNull(
                    pVaccine.VaccineName,
                    "pVaccine.VaccineName");

                Verify.ArgumentNotSpecified(
                    pVaccine.VaccineName.Length == 0,
                    "pVaccine.VaccineName");

                Verify.ArgumentNotSpecified(
                    pVaccine.ManufacturersID <= 0,
                    "pVaccine.ManufacturersID");


                conn = new SqlConnection(
                    ConfigurationManager
                    .ConnectionStrings["DEFAULT"].ToString());

                conn.Open();

                int recordsAffected = VaccineByVaccineIdUpdateWrapper
                                      .ExecuteNonQuery(
                    conn,
                    pVaccine.VaccineID,
                    pVaccine.VaccineName,
                    pVaccine.VaccineSort,
                    pVaccine.ManufacturersID,
                    pVaccine.VaccinePrice,
                    pVaccine.VaccineQuantity);


                conn.Close();

                if (recordsAffected == 0)
                {
                    throw new Exception("Vaccine update failure!");
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.DealWithException(ex);
                //switch (ex.GetType().FullName)
                //{
                //    case "System.ArgumentNullException":
                //        {
                //            throw new ArgumentNullException(ex.Message);
                //        }
                //    case "System.ArgumentException":
                //        {
                //            throw new ArgumentException(ex.Message);
                //        }
                //    default:
                //        throw new Exception(ex.Message);
                //}
            }
            #region Dispose

            finally
            {
                if (conn != null)
                {
                    conn.Dispose();
                }
            }

            #endregion
        }
        void IManagerUserStorage.UpdateManagerUser(ManagerUser pManagerUser)
        {
            SqlConnection conn = null;

            try
            {
                Verify.ArgumentNotNull(pManagerUser, "pManagerUser");

                Verify.ArgumentNotSpecified(
                    pManagerUser.UserID <= 0,
                    "pManagerUser.UserID");

                Verify.ArgumentNotNull(
                    pManagerUser.UserName,
                    "pManagerUser.UserName");

                Verify.ArgumentNotSpecified(
                    (pManagerUser.UserName.Length == 0),
                    "pManagerUser.UserName");

                Verify.ArgumentNotNull(
                    pManagerUser.UserPassword,
                    "pManagerUser.UserPassword");

                Verify.ArgumentNotSpecified(
                    (pManagerUser.UserPassword.Length == 0),
                    "pManagerUser.UserPassword");

                conn = new SqlConnection(
                    ConfigurationManager
                    .ConnectionStrings["DEFAULT"].ToString());

                conn.Open();

                int recordsAffected = ManagerUserByUserIdUpdateWrapper
                                      .ExecuteNonQuery(
                    conn,
                    pManagerUser.UserID,
                    pManagerUser.UserName,
                    pManagerUser.UserPassword,
                    pManagerUser.UserSort);

                conn.Close();

                if (recordsAffected == 0)
                {
                    throw new Exception("ManagerUser update failure!");
                }
            }
            catch (Exception ex)
            {
                switch (ex.GetType().FullName)
                {
                case "System.ArgumentNullException":
                {
                    throw new ArgumentNullException(ex.Message);
                }

                case "System.ArgumentException":
                {
                    throw new ArgumentException(ex.Message);
                }

                default:
                    throw new Exception(ex.Message);
                }
            }


            #region Dispose

            finally
            {
                if (conn != null)
                {
                    conn.Dispose();
                }
            }

            #endregion
        }
        ManagerUserPicture IManagerUserPictureStorage.CreateManagerUserPicture(
            ManagerUserPicture pManagerUserPicture)
        {
            SqlConnection conn = null;

            try
            {
                Verify.ArgumentNotNull(pManagerUserPicture, "pManagerUserPicture");


                Verify.ArgumentNotSpecified(
                    (pManagerUserPicture.UserID <= 0),
                    "pManagerUserPicture.UserID");


                int?newUserId;

                conn = new SqlConnection(
                    ConfigurationManager
                    .ConnectionStrings["DEFAULT"].ToString());

                conn.Open();

                int recordsAffected = ManagerUserPictureCreateWrapper.ExecuteNonQuery(
                    conn,
                    pManagerUserPicture.UserID,
                    pManagerUserPicture.UserPic,
                    out newUserId);

                pManagerUserPicture.UserPicID = Convert.ToInt32(newUserId);


                conn.Close();

                if (recordsAffected == 0)
                {
                    throw new Exception("ManagerUserPicture create failure!");
                }
            }
            catch (Exception ex)
            {
                switch (ex.GetType().FullName)
                {
                case "System.ArgumentNullException":
                {
                    throw new ArgumentNullException(ex.Message);
                }

                case "System.ArgumentException":
                {
                    throw new ArgumentException(ex.Message);
                }

                default:
                    throw new Exception(ex.Message);
                }
            }

            #region Dispose

            finally
            {
                if (conn != null)
                {
                    conn.Dispose();
                }
            }

            #endregion

            return(pManagerUserPicture);
        }