Esempio n. 1
0
        public ActionResult EditOrganization(CreateOrganization organization, HttpPostedFileBase LogoImage)
        {
            try
            {
                Organization organi = new Organization();
                if (LogoImage != null)
                {
                    string logoName = WsConstant.randomString() + Path.GetExtension(LogoImage.FileName).ToLower();
                    string path     = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Content/Upload"), logoName);
                    LogoImage.SaveAs(path);
                    organization.LogoUrl = "/Content/Upload/" + logoName;
                }

                using (var db = new OrganizationDAL())
                {
                    organi = db.EditOrganization(organization, User.Identity.Name);
                }
                return(Redirect("/#/OrganizationDetail/" + organi.OrganizationId));
            }
            catch (Exception)
            {
                return(Redirect("/#/Error"));
            }
        }