Beispiel #1
0
        public void updateStores(string storename, string storetype, string shortdesc, string storedesc, string brands, string othercategories, string iscreditcard, string istrail, string ishomedelivery, string ownerfirstname, string ownerlastname, string phone, string email, string addline1, string addline2, string city, string state, string country, string pincode, string latitude, string longitude, string websiteurl, string fburl, string twitterurl, string googleurl, string clientID)
        {
            //1. update store table
            //2. add brands to brand table
            //3. add categories ro categories table
            try
            {
                MySQLBusinessLogic bl = new MySQLBusinessLogic();
                //Check for Email availability
                bool emailAvailability = false;
                //if (email != "")
                //    emailAvailability = bl.CheckEmailExistance(email);

                //bool moblenumberAvailability = bl.CheckPhoneExistance(storename, phone);

                //if (!emailAvailability)
                //{

                //    //Check for Mobile availability
                //    if (!moblenumberAvailability)
                //    {

                //    }
                //    else
                //    {
                //        //mobile
                //        Clients.Client(clientID).updatedStores("4");
                //    }
                //}
                //else
                //{
                //    //email id
                //    Clients.Client(clientID).updatedStores("3");
                //}
                int storeID = GetStoreIDbyPhone(phone);
                bool result = bl.UpdateStoreDetails(storename, storetype, shortdesc, storedesc, brands, othercategories, Convert.ToInt32(iscreditcard), Convert.ToInt32(istrail), Convert.ToInt32(ishomedelivery), ownerfirstname, ownerlastname, phone, email, addline1, addline2, city, state, country, pincode, Convert.ToDouble(latitude), Convert.ToDouble(longitude), websiteurl, fburl, twitterurl, googleurl, DateTime.Now, storeID);

                //Update Brands

                //Update Other categories

                bool catResult = bl.UpdateOtherCategories(storeID, othercategories);
                bool brabdResult = bl.UpdateBrands(storeID, brands);

                if (result == true)
                    Clients.Client(clientID).updatedStores("1");
                else
                    Clients.Client(clientID).updatedStores("0");
            }
            catch (Exception ex)
            {
                Clients.Client(clientID).updatedStores("0");
            }
        }