Esempio n. 1
0
        /// <summary>
        /// Copies the specified accessory to another firearm..
        /// </summary>
        /// <param name="databasePath">The database path.</param>
        /// <param name="itemId">The item identifier.</param>
        /// <param name="gunId">The gun identifier.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        /// <exception cref="Exception"></exception>
        /// <exception cref="Exception"></exception>
        public static bool Copy(string databasePath, long itemId, long gunId, out string errOut)
        {
            bool bAns = false;

            try
            {
                BSOtherObjects         obj     = new BSOtherObjects();
                List <AccessoriesList> details = List(databasePath, (int)itemId, out errOut);
                if (errOut?.Length > 0)
                {
                    throw new Exception(errOut);
                }
                foreach (AccessoriesList d in details)
                {
                    bAns = Add(databasePath, gunId, obj.FC(d.Manufacturer), obj.FC(d.Model), obj.FC(d.SerialNumber), obj.FC(d.Condition), obj.FC(d.Notes),
                               obj.FC(d.Use), Convert.ToDouble(d.PurchaseValue), Convert.ToDouble(d.AppriasedValue), d.CountInValue,
                               d.IsChoke, out errOut);
                    if (errOut?.Length > 0)
                    {
                        throw new Exception(errOut);
                    }
                }
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("Copy", e);
            }
            return(bAns);
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut       = @"";
            _databasePath = Vs2019.GetSetting("DatabasePath", TestContext);
            _crReportName = obj.FC(Vs2019.GetSetting("CR_ReportName", TestContext));
            _crSql        = obj.FC(Vs2019.GetSetting("CR_SQL", TestContext));
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut            = @"";
            _databasePath      = Vs2019.GetSetting("DatabasePath", TestContext);
            _gunId             = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            _shopsName         = obj.FC(Vs2019.GetSetting("Shops_Name", TestContext));
            _shopsNameExisting = obj.FC(Vs2019.GetSetting("Shops_Name_Existing", TestContext));
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            _errOut = @"";
            BSOtherObjects obj = new BSOtherObjects();

            _databasePath                          = Vs2019.GetSetting("DatabasePath", TestContext);
            _maintenancePlansName                  = obj.FC(Vs2019.GetSetting("MaintenancePlans_Name", TestContext));
            _maintenancePlansOperationDetails      = obj.FC(Vs2019.GetSetting("MaintenancePlans_OperationDetails", TestContext));
            _maintenancePlansIntervalsInDays       = obj.FC(Vs2019.GetSetting("MaintenancePlans_IntervalsInDays", TestContext));
            _maintenancePlansNotes                 = obj.FC(Vs2019.GetSetting("MaintenancePlans_Notes", TestContext));
            _maintenancePlansIntervalInRoundsFired = obj.FC(Vs2019.GetSetting("MaintenancePlans_IntervalInRoundsFired", TestContext));
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut                 = @"";
            _databasePath           = Vs2019.GetSetting("DatabasePath", TestContext);
            _gunId                  = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            _gunSmithName           = obj.FC(Vs2019.GetSetting("GunSmith_Name", TestContext));
            _gunDetailsOrderDetails = obj.FC(Vs2019.GetSetting("GunDetails_OrderDetails", TestContext));
            _gunDetailsNotes        = obj.FC(Vs2019.GetSetting("GunDetails_Notes", TestContext));
            _gunDetailsStartDate    = Vs2019.GetSetting("GunDetails_StartDate", TestContext);
            _gunDetailsReturnDate   = Vs2019.GetSetting("GunDetails_ReturnDate", TestContext);
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut         = @"";
            _databasePath   = Vs2019.GetSetting("DatabasePath", TestContext);
            _gunId          = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            Doc_Title       = obj.FC(Vs2019.GetSetting("Doc_Title", TestContext));
            Doc_Description = obj.FC(Vs2019.GetSetting("Doc_Description", TestContext));
            Doc_Category    = obj.FC(Vs2019.GetSetting("Doc_Category", TestContext));
            Doc_Ext         = obj.FC(Vs2019.GetSetting("Doc_Ext", TestContext));
            Doc_Path        = Vs2019.GetSetting("Doc_Path", TestContext);
            Doc_Ext_Number  = Convert.ToInt32(Vs2019.GetSetting("Doc_Ext_Number", TestContext));
        }
Esempio n. 7
0
        /// <summary>
        /// Gets the identifier.
        /// </summary>
        /// <param name="databaseName">Name of the database.</param>
        /// <param name="name">The name.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns>System.Int64.</returns>
        /// <exception cref="Exception"></exception>
        public static long GetId(string databaseName, string name, out string errOut)
        {
            long lAns = 0;

            errOut = @"";
            try
            {
                BSOtherObjects obj = new BSOtherObjects();
                name = obj.FC(name);
                List <GlobalCaliberList> lst = GetList(databaseName, name, out errOut);
                if (errOut.Length > 0)
                {
                    throw new Exception($"{errOut}");
                }
                foreach (GlobalCaliberList g in lst)
                {
                    lAns = g.Id;
                }
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("GetId", e);
            }

            return(lAns);
        }
Esempio n. 8
0
            /// <summary>
            /// Moves the gun smiths.
            /// </summary>
            /// <param name="databasePath">The database path.</param>
            /// <param name="errOut">The error out.</param>
            /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
            /// <exception cref="System.Exception"></exception>
            /// <exception cref="System.Exception"></exception>
            internal static bool MoveGunSmiths(string databasePath, out string errOut)
            {
                errOut = "";
                bool   bAns = false;
                string sql  = "";

                try
                {
                    List <GunSmithWorkDone> lst = GunSmithDetails.Lists(databasePath, out errOut, true);
                    if (errOut.Length > 0)
                    {
                        throw new Exception(errOut);
                    }
                    BSOtherObjects obj = new BSOtherObjects();
                    foreach (GunSmithWorkDone l in lst)
                    {
                        string name = obj.FC(l.GunSmithName);
                        if (!ValueDoesExist(databasePath, "GunSmith_Contact_Details", "gName", name, out errOut))
                        {
                            if (!PeopleAndPlaces.GunSmiths.Add(databasePath, name, out errOut))
                            {
                                throw new Exception(errOut);
                            }
                        }
                    }
                    bAns = true;
                }
                catch (Exception e)
                {
                    errOut = $"{ErrorMessage("MoveGunSmiths", e)}.  {Environment.NewLine} {Environment.NewLine}SQL - {sql}";
                }
                return(bAns);
            }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            _errOut = @"";
            BSOtherObjects obj = new BSOtherObjects();

            _databasePath    = Vs2019.GetSetting("DatabasePath", TestContext);
            _nationalityName = obj.FC(Vs2019.GetSetting("Nationality_Name", TestContext));
        }
Esempio n. 10
0
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut         = @"";
            _databasePath   = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Vs2019.GetSetting("DatabasePath", TestContext));
            _gunId          = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            _shopOldName    = obj.FC(Vs2019.GetSetting("MyGunCollection_ShopOldName", TestContext));
            _shopNewName    = obj.FC(Vs2019.GetSetting("MyGunCollection_ShopNewName", TestContext));
            _fullName       = "Glock Super Carry";
            _serialNumber   = "RIA2323423";
            _manufacturesId = Manufacturers.GetId(_databasePath, "Glock", out _errOut);
            _modelId        = Models.GetId(_databasePath, "G26", _manufacturesId, out _errOut);
            _nationalityId  = Nationality.GetId(_databasePath, "USA", out _errOut);
            _gripId         = Grips.GetId(_databasePath, "Plastic", out _errOut);
            _soldGunId      = Vs2019.IGetSetting("SoldFirearmId", TestContext);
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut             = @"";
            _databasePath       = Vs2019.GetSetting("DatabasePath", TestContext);
            _classificationName = obj.FC(Vs2019.GetSetting("Classification_Name", TestContext));
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut              = @"";
            _databasePath        = Vs2019.GetSetting("DatabasePath", TestContext);
            _crColumnTableId     = Vs2019.IGetSetting("CR_Column_TableId", TestContext);
            _crColumnDisplayName = obj.FC(Vs2019.GetSetting("CR_Column_DisplayName", TestContext));
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            _errOut = @"";
            BSOtherObjects obj = new BSOtherObjects();

            _databasePath         = Vs2019.GetSetting("DatabasePath", TestContext);
            _modelsName           = obj.FC(Vs2019.GetSetting("Models_Name", TestContext));
            _modelsManufacturerId = Vs2019.IGetSetting("Models_ManufacturerId", TestContext);
        }
Esempio n. 14
0
        /// <summary>
        /// Adds the specified database path.
        /// </summary>
        /// <param name="databasePath">The database path.</param>
        /// <param name="name">The name.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public static bool Add(string databasePath, string name, out string errOut)
        {
            bool bAns = false;

            errOut = @"";
            try
            {
                BSOtherObjects obj = new BSOtherObjects();
                name = obj.FC(name);
                string sql = $"INSERT INTO Gun_Manufacturer(Brand,sync_lastupdate) VALUES('{name}',Now())";
                bAns = Database.Execute(databasePath, sql, out errOut);
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("Add", e);
            }

            return(bAns);
        }
Esempio n. 15
0
        /// <summary>
        /// Updates the specified database path.
        /// </summary>
        /// <param name="databasePath">The database path.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public static bool Update(string databasePath, long id, string name, out string errOut)
        {
            bool bAns = false;

            errOut = @"";
            try
            {
                BSOtherObjects obj = new BSOtherObjects();
                name = obj.FC(name);
                string sql = $"UPDATE Gun_Cal set Cal='{name}',sync_lastupdate=Now() where id={id}";
                bAns = Database.Execute(databasePath, sql, out errOut);
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("Update", e);
            }

            return(bAns);
        }
Esempio n. 16
0
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut               = @"";
            _databasePath         = Vs2019.GetSetting("DatabasePath", TestContext);
            _wishListManufacturer = obj.FC(Vs2019.GetSetting("WishList_Manufacturer", TestContext));
            _wishListModel        = obj.FC(Vs2019.GetSetting("WishList_Model", TestContext));
            _wishListPlaceToBuy   = obj.FC(Vs2019.GetSetting("WishList_PlaceToBuy", TestContext));
            _wishListQty          = obj.FC(Vs2019.GetSetting("WishList_Qty", TestContext));
            _wishListPrice        = obj.FC(Vs2019.GetSetting("WishList_Price", TestContext));
            _wishListNotes        = obj.FC(Vs2019.GetSetting("WishList_Notes", TestContext));
        }
Esempio n. 17
0
        /// <summary>
        /// Gets the identifier.
        /// </summary>
        /// <param name="databasePath">The database path.</param>
        /// <param name="name">The name.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns>System.Int64.</returns>
        /// <exception cref="Exception"></exception>
        /// <exception cref="Exception"></exception>
        /// <exception cref="Exception"></exception>
        public static long GetId(string databasePath, string name, out string errOut)
        {
            long lAns = 0;

            errOut = @"";
            try
            {
                BSOtherObjects obj = new BSOtherObjects();
                name = obj.FC(name);

                if (!Exists(databasePath, name, out errOut))
                {
                    if (!Add(databasePath, name, out errOut))
                    {
                        throw new Exception(errOut);
                    }
                }
                if (errOut?.Length > 0)
                {
                    throw new Exception(errOut);
                }

                string    sql = $"SELECT ID from Gun_Manufacturer where Brand='{name}'";
                DataTable dt  = Database.GetDataFromTable(databasePath, sql, out errOut);
                if (errOut?.Length > 0)
                {
                    throw new Exception(errOut);
                }
                foreach (DataRow d in dt.Rows)
                {
                    lAns = Convert.ToInt32(d["id"]);
                }
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("GetId", e);
            }

            return(lAns);
        }
Esempio n. 18
0
        /// <summary>
        /// Updates the specified database path.
        /// </summary>
        /// <param name="databasePath">The database path.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public static bool Update(string databasePath, long id, string name, out string errOut)
        {
            bool bAns = false;

            errOut = @"";
            try
            {
                BSOtherObjects obj = new BSOtherObjects();
                name = obj.FC(name);
                string sql = $"UPDATE Gun_Manufacturer set Brand='{name}' where id={id}";
                bAns = Database.Execute(databasePath, sql, out errOut);
                if (errOut?.Length > 0)
                {
                    throw new Exception($"{errOut}{Environment.NewLine}SQL - {sql}");
                }
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("Update", e);
            }

            return(bAns);
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut                          = @"";
            _databasePath                    = Vs2019.GetSetting("DatabasePath", TestContext);
            _gunId                           = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            _barrelConvoKitDefaultId         = Vs2019.IGetSetting("BarrelConvoKit_DefaultId", TestContext);
            _barrelConvoKitAddModelName      = Vs2019.GetSetting("BarrelConvoKit_Add_ModelName", TestContext);
            _barrelConvoKitAddCaliber        = Vs2019.GetSetting("BarrelConvoKit_Add_Caliber", TestContext);
            _barrelConvoKitAddFinish         = Vs2019.GetSetting("BarrelConvoKit_Add_Finish", TestContext);
            _barrelConvoKitAddBarrelLength   = Vs2019.GetSetting("BarrelConvoKit_Add_BarrelLength", TestContext);
            _barrelConvoKitAddPetLoads       = Vs2019.GetSetting("BarrelConvoKit_Add_PetLoads", TestContext);
            _barrelConvoKitAddAction         = Vs2019.GetSetting("BarrelConvoKit_Add_Action", TestContext);
            _barrelConvoKitAddFeedsystem     = Vs2019.GetSetting("BarrelConvoKit_Add_Feedsystem", TestContext);
            _barrelConvoKitAddSights         = Vs2019.GetSetting("BarrelConvoKit_Add_Sights", TestContext);
            _barrelConvoKitAddPurchasedPrice = Vs2019.GetSetting("BarrelConvoKit_Add_PurchasedPrice", TestContext);
            _barrelConvoKitAddPurchasedFrom  = obj.FC(Vs2019.GetSetting("BarrelConvoKit_Add_PurchasedFrom", TestContext));
            _barrelConvoKitAddHeight         = Vs2019.GetSetting("BarrelConvoKit_Add_Height", TestContext);
            _barrelConvoKitAddType           = Vs2019.GetSetting("BarrelConvoKit_Add_Type", TestContext);
            _barrelConvoKitAddIsDefault      = Vs2019.BGetSetting("BarrelConvoKit_Add_IsDefault", TestContext);
        }
Esempio n. 20
0
            /// <summary>
            /// Moves the appraisers.
            /// </summary>
            /// <param name="databasePath">The database path.</param>
            /// <param name="errOut">The error out.</param>
            /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
            /// <exception cref="System.Exception"></exception>
            /// <exception cref="System.Exception"></exception>
            internal static bool MoveAppraisers(string databasePath, out string errOut)
            {
                errOut = "";
                bool   bAns = false;
                string sql  = "";

                try
                {
                    List <GunCollectionList> lst = MyCollection.GetList(databasePath, out errOut);
                    if (errOut.Length > 0)
                    {
                        throw new Exception(errOut);
                    }
                    BSOtherObjects obj = new BSOtherObjects();
                    foreach (GunCollectionList l in lst)
                    {
                        string name = obj.FC(l.AppriasedBy);
                        if (name?.Length == 0 || name == null)
                        {
                            name = "  ";
                        }
                        if (!ValueDoesExist(databasePath, "Appriaser_Contact_Details", "aName", name, out errOut))
                        {
                            if (!PeopleAndPlaces.Appraisers.Add(databasePath, name, out errOut))
                            {
                                throw new Exception(errOut);
                            }
                        }
                    }
                    bAns = true;
                }
                catch (Exception e)
                {
                    errOut = $"{ErrorMessage("MoveAppraisers", e)}.  {Environment.NewLine} {Environment.NewLine}SQL - {sql}";
                }
                return(bAns);
            }
Esempio n. 21
0
        /// <summary>
        /// Existses the specified database path.
        /// </summary>
        /// <param name="databasePath">The database path.</param>
        /// <param name="name">The name.</param>
        /// <param name="errOut">The error out.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        /// <exception cref="Exception"></exception>
        public static bool Exists(string databasePath, string name, out string errOut)
        {
            bool bAns = false;

            errOut = @"";
            try
            {
                BSOtherObjects obj = new BSOtherObjects();
                name = obj.FC(name);
                string    sql = $"Select * from Gun_Manufacturer where Brand='{name}'";
                DataTable dt  = Database.GetDataFromTable(databasePath, sql, out errOut);
                if (errOut?.Length > 0)
                {
                    throw new Exception(errOut);
                }
                bAns = dt.Rows.Count > 0;
            }
            catch (Exception e)
            {
                errOut = ErrorMessage("Exists", e);
            }

            return(bAns);
        }
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            BSOtherObjects obj = new BSOtherObjects();

            _errOut                  = @"";
            _databasePath            = Vs2019.GetSetting("DatabasePath", TestContext);
            _gunId                   = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            _accessoriesManufacturer = obj.FC(Vs2019.GetSetting("Accessories_Manufacturer", TestContext));
            _accessoriesName         = obj.FC(Vs2019.GetSetting("Accessories_Name", TestContext));
            _accessoriesSerialNumber = obj.FC(Vs2019.GetSetting("Accessories_serialNumber", TestContext));
            _accessoriesCondition    = obj.FC(Vs2019.GetSetting("Accessories_condition", TestContext));
            _accessoriesNotes        = obj.FC(Vs2019.GetSetting("Accessories_notes", TestContext));
            _accessoriesUse          = obj.FC(Vs2019.GetSetting("Accessories_use", TestContext));
            _accessoriesPurValue     = Vs2019.DGetSetting("Accessories_purValue", TestContext);
            _accessoriesAppValue     = Vs2019.DGetSetting("Accessories_appValue", TestContext);
            _accessoriesCiv          = Vs2019.BGetSetting("Accessories_civ", TestContext);
            _accessoriesIc           = Vs2019.BGetSetting("Accessories_ic", TestContext);
        }
Esempio n. 23
0
        public void Init()
        {
            // Vs2019.GetSetting("", TestContext);
            // obj.FC(Vs2019.GetSetting("", TestContext));
            BSOtherObjects obj = new BSOtherObjects();

            _errOut        = @"";
            _databasePath  = Vs2019.GetSetting("DatabasePath", TestContext);
            _gunId         = Vs2019.IGetSetting("MyGunCollectionID", TestContext);
            _buyerName     = obj.FC(Vs2019.GetSetting("Buyer_Name", TestContext));
            _buyerAddress1 = obj.FC(Vs2019.GetSetting("Buyer_Address1", TestContext));
            _buyerAddress2 = obj.FC(Vs2019.GetSetting("Buyer_Address2", TestContext));
            _buyerCity     = obj.FC(Vs2019.GetSetting("Buyer_City", TestContext));
            _buyerState    = obj.FC(Vs2019.GetSetting("Buyer_State", TestContext));
            _buyerZipCode  = obj.FC(Vs2019.GetSetting("Buyer_ZipCode", TestContext));
            _buyerPhone    = obj.FC(Vs2019.GetSetting("Buyer_Phone", TestContext));
            _buyerCountry  = obj.FC(Vs2019.GetSetting("Buyer_Country", TestContext));
            _buyerEMail    = obj.FC(Vs2019.GetSetting("Buyer_eMail", TestContext));
            _buyerLic      = obj.FC(Vs2019.GetSetting("Buyer_Lic", TestContext));
            _buyerDLic     = obj.FC(Vs2019.GetSetting("Buyer_dLic", TestContext));
            _buyerDob      = obj.FC(Vs2019.GetSetting("Buyer_DOB", TestContext));
            _buyerResident = obj.FC(Vs2019.GetSetting("Buyer_Resident", TestContext));
            _buyerFax      = obj.FC(Vs2019.GetSetting("Buyer_Fax", TestContext));
            _buyerWebSite  = obj.FC(Vs2019.GetSetting("Buyer_WebSite", TestContext));
        }