public ActionResult RegisterManager(string fullname, string email, string number, string warehousename, string warehouseaddress, string username, string password, string password2, HttpPostedFileBase warehouselogo, string countries)
        {
            string thePictureDataAsString = "";

            if (warehouselogo != null)
            {
                string theFileName       = Path.GetFileName(warehouselogo.FileName);
                byte[] thePictureAsBytes = new byte[warehouselogo.ContentLength];
                using (BinaryReader theReader = new BinaryReader(warehouselogo.InputStream))
                {
                    thePictureAsBytes = theReader.ReadBytes(warehouselogo.ContentLength);
                }
                thePictureDataAsString = Convert.ToBase64String(thePictureAsBytes);
            }
            WarehouseBusinessLayer wbl = new WarehouseBusinessLayer();



            UserAccount useracc = new UserAccount();

            useracc.Name            = fullname;
            useracc.Email           = email;
            useracc.Contact         = number;
            useracc.Password        = password;
            useracc.ConfirmPassword = password;
            useracc.Registered      = DateTime.Now.ToShortDateString();
            useracc.Role            = "Manager";
            useracc.UserName        = username;

            //   ConsignmentBusinessLayer cbl = new ConsignmentBusinessLayer();
            // cbl.addAccount(useracc);
            WarehouseDBEntities wde = new WarehouseDBEntities();

            wde.UserAccounts.Add(useracc);
            try
            {
                wde.SaveChanges();
            }
            catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)
            {
                Exception raise = dbEx;
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        string message = string.Format("{0}:{1}",
                                                       validationErrors.Entry.Entity.ToString(),
                                                       validationError.ErrorMessage);
                        // raise a new exception nesting
                        // the current instance as InnerException
                        raise = new InvalidOperationException(message, raise);
                    }
                }
                throw raise;
            }


            int Managerid = wbl.getRecentlyId();

            wbl.createWarehouse(Managerid, warehousename, warehouseaddress, thePictureDataAsString, countries);

            Session["UserID"]   = wbl.getRecentlyId();
            Session["Username"] = username;

            return(RedirectToAction("LoggedIn"));
        }