Пример #1
0
        public ActionResult Save(Ca_CS cdcs)
        {
            //cdcs.Usuarios = users.ObtenerUsuario(cdcs.Id_Usuario.Value);

            if (ModelState.IsValid)
            {
                cdcs.F_Alta     = DateTime.Now;
                cdcs.Creado_por = int.Parse(Session["IdUser"].ToString());
                int i = socios.Guardar(cdcs);
                if (i == 0)
                {
                    ViewBag.showError = true;
                    ViewBag.OnIdError = cdcs.Id_CS;
                    return(PartialView("~/Views/CS/EditCS.cshtml", cdcs));
                }
            }
            else
            {
                cdcs.F_Alta     = DateTime.Now;
                cdcs.Creado_por = int.Parse(Session["IdUser"].ToString());
                int i = socios.Guardar(cdcs);
                if (i == 0)
                {
                    ViewBag.showError = true;
                    ViewBag.OnIdError = cdcs.Id_CS;
                    return(PartialView("~/Views/CS/EditCS.cshtml", cdcs));
                }
            }
            return(JavaScript("PopupOnClosed()"));
        }