Пример #1
0
        public ActionResult AgregarPer(Personaje P)
        {
            try
            {
                if (Session["Admin"].ToString() != "Admin")
                {
                    return RedirectToAction("AD", "BackOffice");
                }
                else
                {
                    int tamaño = P.Foto.ContentLength;
                    byte[] ImagenOriginal = new byte[tamaño];
                    P.Foto.InputStream.Read(ImagenOriginal, 0, tamaño);
                    P.FotoByte = ImagenOriginal;

                    Session["Msg"] = BD.AgregarP(P);
                    return RedirectToAction("ABMPer", "BackOffice");
                }
            }
            catch (NullReferenceException)
            {
                return RedirectToAction("AD", "BackOffice");
            }
        }