public ActionResult addsolisitud(soliadmin model)
 {
     Guid id = (Guid)Membership.GetUser().ProviderUserKey;
     model.UserId = id;
     model.regsolisitud(model);
     return RedirectToAction("solisitud1", "solisitud");
 }
Example #2
0
 public void regsolisitud(soliadmin model)
 {
     solisitud solisitud=new solisitud()
     {
         solisitudes="solisita ser Administrador",
         fecha = DateTime.Today,
         UserId = model.UserId
     };
     db.solisitud.InsertOnSubmit(solisitud);
     db.SubmitChanges();
 }
 public ActionResult aceptarsol(Guid UserId,soliadmin model)
 {
     DataClasses1DataContext db = new DataClasses1DataContext();
     Guid idu = UserId;
     Guid idr=(from r in db.aspnet_Roles where r.RoleName=="Administrador" select r.RoleId).ToArray()[0];
     model.regroll(idu,idr);
     using (DataClasses1DataContext dbb = new DataClasses1DataContext())
     {
         ViewBag.p = (from c in dbb.solisitud where c.UserId == UserId select c).ToList();
         foreach (var del in @ViewBag.p)
             db.solisitud.DeleteOnSubmit(del);
         db.SubmitChanges();
     }
     return RedirectToAction("aceptsolisitud", "solisitud");
 }