Пример #1
0
 public ActionResult UserNormalInsert([FromBody] CRUDModel <Models.PSAVCrud.SyncModels.UsersModel> value)
 {
     Models.PSAVCrud.SyncModels.UsersModel val = value.Value;
     val.ID = ConSQL.UpdateUsers(value.Value, 0);
     UsersList.Insert(CoinsList.Count, val);
     return(Json(CoinsList));
 }
Пример #2
0
        public ActionResult UserNormalUpdate([FromBody] CRUDModel <Models.PSAVCrud.SyncModels.UsersModel> myObject)
        {
            var ord = myObject.Value;

            Models.PSAVCrud.SyncModels.UsersModel val = UsersList.Where(or => or.ID == ord.ID).FirstOrDefault();
            val.ID = ord.ID; val.Active = ord.Active; val.Username = ord.Username; val.Expira = ord.Expira;
            ConSQL.UpdateUsers(val, 1);
            return(Json(myObject.Value));
        }
Пример #3
0
        public ActionResult SaveNewUser(Models.PSAVCrud.SyncModels.NewUser model)
        {
            string IDClient = ConSQL.SavePerson(model);

            Models.PSAVCrud.SyncModels.UsersModel UM = new Models.PSAVCrud.SyncModels.UsersModel();
            UM.Active   = "1";
            UM.Expira   = model.Expira;
            UM.Persona  = IDClient;
            UM.Username = model.UserName;
            UM.Password = model.Password;
            string IDU = ConSQL.UpdateUsers(UM, 0);

            ConSQL.SaveRolUser(IDU, "1");
            return(RedirectToAction("Usuarios"));
        }
Пример #4
0
 public ActionResult EditUsuario(string usn)
 {
     Models.PSAVCrud.SyncModels.UsersModel UM = ConSQL.GetUser(usn);
     return(View(UM));
 }
Пример #5
0
 public ActionResult SaveUserEdit(Models.PSAVCrud.SyncModels.UsersModel model)
 {
     ConSQL.UpdateUsers(model, 1);
     return(RedirectToAction("Usuarios"));
 }