public async Task <IHttpActionResult> PutLOGIN(int id, LOGIN lOGIN) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != lOGIN.ID) { return(BadRequest()); } db.Entry(lOGIN).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LOGINExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Login(LOGIN login) { if (ModelState.IsValid) { Varlık_Envanter_TakippEntities db = new Varlık_Envanter_TakippEntities(); var user = (from userlist in db.LOGINs where userlist.KULLANICI_ADI == login.KULLANICI_ADI && userlist.PAROLA == login.PAROLA select new { userlist.ID, userlist.KULLANICI_ADI }).ToList(); if (user.FirstOrDefault() != null) { Session["KULLANICI_ADI"] = user.FirstOrDefault().KULLANICI_ADI; Session["ID"] = user.FirstOrDefault().ID; return(Redirect("/home/Create")); } else { ModelState.AddModelError("", "Yetkisiz kullanıcı erişimi"); } } return(View(login)); }
public void TestMethodDetail3() { int id = 01; LOGIN result = login.detail(id); Assert.IsNotNull(result); }
private void button1_Click(object sender, EventArgs e) { LOGIN aLogin = new LOGIN(); aLogin.Show(); this.Hide(); }
protected void btnRegistroSalida_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(5000); long estacionamiento = Convert.ToInt64(idEstacionamiento); LOGIN conserje = (LOGIN)Session["conserje"]; string resultBoleta = Controller.ControllerBoleta.crearBoletaEst(estacionamiento, conserje.ID_PERSONA, total); if (resultBoleta.Equals("Boleta Creada")) { BOLETA boleta = Controller.ControllerBoleta.buscarBoletaEst(estacionamiento); string date = DateTime.Now.Date.ToString(); string patente = txtPatente.Text; string horaS = date.Substring(0, 10) + " " + txtHoraSalida.Text; string resultEst = Controller.ControllerEstacionamientoVisita.salidaEstacionamiento(estacionamiento, boleta.ID_BOLETA, horaS, total, false); if (resultEst.Equals("Salida Registrada")) { Session["SalidaEst"] = null; ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Salida Estacionamiento Registrado');window.location.href='" + Request.RawUrl + "';", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Error al Registrar Estacionamiento');window.location.href='" + Request.RawUrl + "';", true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Error al Registrar Salida Estacionamiento');window.location.href='" + Request.RawUrl + "';", true); } }
public bool LoginAdd(int appId, LOGIN inEnt) { using (DBEntities db = new DBEntities()) { var login = db.YL_LOGIN.SingleOrDefault(x => x.LOGIN_NAME == inEnt.LOGIN_NAME); var oauth = db.YL_OAUTH.SingleOrDefault(x => x.KEY == appId); if (oauth == null) { return(false); } if (login == null) { login = Fun.ClassToCopy <LOGIN, YL_LOGIN>(inEnt); login.ID = Fun.GetSeqID <YL_LOGIN>(); if (string.IsNullOrEmpty(login.REGION)) { login.REGION = "1"; } login.YL_OAUTH.Add(oauth); db.YL_LOGIN.Add(login); } else { if (login.YL_OAUTH.SingleOrDefault(x => x.KEY == appId) == null) { login.YL_OAUTH.Add(oauth); } } db.SaveChanges(); return(true); } }
protected void Page_Load(object sender, EventArgs e) { //Validación de Session Iniciada LOGIN adm = (LOGIN)Session["adm"]; LOGIN conserje = (LOGIN)Session["conserje"]; LOGIN vendedor = (LOGIN)Session["vendedor"]; LOGIN propietario = (LOGIN)Session["login"]; LOGIN admCondominio = (LOGIN)Session["admCondominio"]; if (conserje != null || vendedor != null || propietario != null) { Response.Redirect("~/Vista/Index.aspx"); } else if (adm == null && conserje == null && vendedor == null && propietario == null && admCondominio == null) { Response.Redirect("~/Vista/Index.aspx"); } if (!IsPostBack) { if (adm != null) { cargarCondominio(); } else { cargarCondominioAdm(admCondominio.ID_PERSONA); } } }
private void OnExtensionResponse(BaseEvent evt) { String cmd = (String)evt.Params["cmd"]; ISFSObject sfso = (ISFSObject)evt.Params["params"]; Debug.Log(sfso); Debug.Log(cmd); if (cmd == CMD_SUBMIT) { if (sfso.ContainsKey("success")) { Debug.Log("Success, thanks for registering"); //SceneManager.LoadScene(3); //sfs.Send(new LogoutRequest()); SmartFoxConnection.Disconnect(); reset(); // Login with registered account task = LOGIN.REGISTERED; Login(); } else { Debug.Log("SignUp Error:" + (String)evt.Params["errorMessage"]); } } }
protected void Page_Load(object sender, EventArgs e) { //Validación de Session Iniciada LOGIN adm = (LOGIN)Session["adm"]; LOGIN conserje = (LOGIN)Session["conserje"]; LOGIN vendedor = (LOGIN)Session["vendedor"]; LOGIN propietario = (LOGIN)Session["login"]; LOGIN admCondominio = (LOGIN)Session["admCondominio"]; if (conserje != null || vendedor != null || propietario != null || admCondominio != null) { Response.Redirect("~/Vista/Index.aspx"); } else if (adm == null && conserje == null && vendedor == null && propietario == null && admCondominio == null) { Response.Redirect("~/Vista/Index.aspx"); } if (!IsPostBack) { string pagoCondominio = (string)Session["CondominioSinDimension"]; //string gastoCondominio = (string)Session["CondominioSinPago"]; if (pagoCondominio != null) { cargarEdificio(pagoCondominio); } /*if (gastoCondominio != null) * { * Response.Redirect("RegistroGasto.aspx"); * }*/ } }
protected void Page_Load(object sender, EventArgs e) { //Validación de Session Iniciada LOGIN adm = (LOGIN)Session["adm"]; LOGIN conserje = (LOGIN)Session["conserje"]; LOGIN vendedor = (LOGIN)Session["vendedor"]; LOGIN propietario = (LOGIN)Session["login"]; LOGIN admCondominio = (LOGIN)Session["admCondominio"]; if (conserje != null || vendedor != null || propietario != null || admCondominio != null) { Response.Redirect("~/Vista/Index.aspx"); } else if (adm == null && conserje == null && vendedor == null && propietario == null && admCondominio == null) { Response.Redirect("~/Vista/Index.aspx"); } if (!IsPostBack) { cargarRol(); cargarCondominio(); string updatePersonal = (string)Session["ModificarPersonal"]; if (updatePersonal != null) { cargarParametros(updatePersonal); } } }
public HttpResponseMessage postLogin([FromBody] LOGIN login) { ILoginBO loginBO = new LoginBO(); Retorno retorno = new Retorno(); String usuario = login.USUARIO; String senha = login.SENHA; try { retorno = loginBO.logar(usuario, senha); return(new HttpResponseMessage(HttpStatusCode.Created) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } catch (Exception ex) { retorno.status = false; retorno.mensagem = ex.Message; return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } }
public ActionResult DeleteConfirmed(int id) { if (Request.IsAuthenticated) { USER uSER = db.USERs.Find(id); LOGIN LUser = db.LOGINs.Find(id); PAID_STAFF PUser = db.PAID_STAFF.Find(id); VOLUNTEER VUser = db.VOLUNTEERs.Find(id); db.LOGINs.Remove(LUser); if (PUser != null) { db.PAID_STAFF.Remove(PUser); } if (VUser != null) { db.VOLUNTEERs.Remove(VUser); } db.USERs.Remove(uSER); db.SaveChanges(); return(RedirectToAction("Index")); } else { return(RedirectToAction("Index", "Home")); } }
protected void Page_Load(object sender, EventArgs e) { //Validación de Session Iniciada LOGIN adm = (LOGIN)Session["adm"]; LOGIN conserje = (LOGIN)Session["conserje"]; LOGIN vendedor = (LOGIN)Session["vendedor"]; LOGIN propietario = (LOGIN)Session["login"]; LOGIN admCondominio = (LOGIN)Session["admCondominio"]; if (conserje != null || vendedor != null || propietario != null || admCondominio != null) { Response.Redirect("~/Vista/Index.aspx"); } else if (adm == null && conserje == null && vendedor == null && propietario == null && admCondominio == null) { Response.Redirect("~/Vista/Index.aspx"); } if (!IsPostBack) { cargarRegion(); cargarAdministrador(); string pagoCondominio = (string)Session["CondominioSinDimension"]; if (pagoCondominio != null) { Response.Redirect("~/Vista/RegistroDimension.aspx"); } } }
public long SetAcessoLogin(LOGIN item) { var db = new bancodadosEntities(); if (item.ID_LOGIN == 0) { db.AddToLOGIN(item); } else { var q = db.LOGIN.FirstOrDefault(p => p.ID_LOGIN == item.ID_LOGIN); q.ID_LOGIN = item.ID_LOGIN; q.NOME_LOGIN = item.NOME_LOGIN; q.USUARIO_LOGIN = item.USUARIO_LOGIN; q.SENHA_LOGIN = item.SENHA_LOGIN; q.STATUS_LOGIN = item.STATUS_LOGIN; q.ADMIN_LOGIN = item.ADMIN_LOGIN; q.ASSOCIACAO_ID_ASSOCIACAO = item.ASSOCIACAO_ID_ASSOCIACAO; } db.SaveChanges(); long id = item.ID_LOGIN; return(id); }
public void TestMethodDetail() { int id = 0; LOGIN expectResult = null; LOGIN result = login.detail(id); Assert.AreEqual(expectResult, result); }
public ActionResult DeleteConfirmed(int id) { LOGIN lOGIN = db.Logins.Find(id); db.Logins.Remove(lOGIN); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteConfirmed(decimal id) { LOGIN lOGIN = await db.LOGIN.FindAsync(id); db.LOGIN.Remove(lOGIN); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <LOGIN> LoginAPI(string IDCard) { return(await Task.Run(async() => { response = await client.GetAsync("taikhoan/" + IDCard.ToString()); LOGIN loginModel = response.ResultAs <LOGIN>(); return loginModel; })); }
public ActionResult Edit([Bind(Include = "ID_LOGIN,PASS_HASH,USER_NAME")] LOGIN lOGIN) { if (ModelState.IsValid) { db.Entry(lOGIN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lOGIN)); }
public ActionResult AktifConfirmed(int id) { LOGIN lOGIN = db.LOGIN.Find(id); lOGIN.STATUS = true; db.Entry(lOGIN).State = EntityState.Modified; db.SaveChanges(); //db.LOGIN.Remove(lOGIN); return(RedirectToAction("Index")); }
public void TestMethodTambah() { LOGIN log = new LOGIN(); log.ID_LOGIN = 1; int a = login.add(log); Assert.IsNotNull(a); }
public void testeListar() { ILoginBO loginBO = new LoginBO(); LOGIN login = new LOGIN(); Retorno retorno = new Retorno(); retorno = loginBO.listar(); Assert.AreEqual(true, retorno.status, retorno.mensagem); }
public ActionResult Edit([Bind(Include = "LoginId,contraseña")] LOGIN lOGIN) { if (ModelState.IsValid) { db.Entry(lOGIN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lOGIN)); }
public ActionResult Create([Bind(Include = "LoginId,contraseña")] LOGIN lOGIN) { if (ModelState.IsValid) { db.Logins.Add(lOGIN); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lOGIN)); }
protected void Page_Load(object sender, EventArgs e) { //Validación de Session Iniciada LOGIN adm = (LOGIN)Session["adm"]; LOGIN conserje = (LOGIN)Session["conserje"]; LOGIN vendedor = (LOGIN)Session["vendedor"]; LOGIN propietario = (LOGIN)Session["login"]; LOGIN admCondominio = (LOGIN)Session["admCondominio"]; if (vendedor != null || propietario != null) { Response.Redirect("~/Vista/Index.aspx"); } else if (adm == null && conserje == null && vendedor == null && propietario == null && admCondominio == null) { Response.Redirect("~/Vista/Index.aspx"); } if (!IsPostBack) { cargarEdificio(conserje.ID_PERSONA); DateTime fecha = DateTime.Now; txtHoraEntrada.Text = fecha.ToString().Substring(11, 5); txtHoraEntrada.Enabled = false; string registroSalida = (string)Session["ModificarEstacionamiento"]; if (registroSalida != null) { txtHoraSalida.Enabled = true; idEstacionamiento = registroSalida; cargarParametros(registroSalida); } } /* * if (!IsPostBack) * { * long conserje = 2; * cargarEdificio(conserje); * * DateTime fecha = DateTime.Now; * txtHoraEntrada.Text = fecha.ToString().Substring(11, 5); * txtHoraEntrada.Enabled = false; * * string registroSalida = (string)Session["SalidaEst"]; * //registroSalida = "8"; * if (registroSalida != null) * { * txtHoraSalida.Enabled = true; * idEstacionamiento = registroSalida; * cargarParametros(registroSalida); * } * }*/ }
public ActionResult Create([Bind(Include = "ID_LOGIN,PASS_HASH,USER_NAME")] LOGIN lOGIN) { if (ModelState.IsValid) { db.LOGIN.Add(lOGIN); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lOGIN)); }
public async Task <IHttpActionResult> GetLOGIN(int id) { LOGIN lOGIN = await db.LOGINs.FindAsync(id); if (lOGIN == null) { return(NotFound()); } return(Ok(lOGIN)); }
public ActionResult Edit([Bind(Include = "ID_LOGIN,ID_PERAN,USERNAME,EMAIL,PASSWORD,STATUS,CREATE_BY,CREATE_DATE,UPDATE_BY,UPDATE_DATE,KETERANGAN")] LOGIN lOGIN) { if (ModelState.IsValid) { db.Entry(lOGIN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_PERAN = new SelectList(db.PERAN, "ID_PERAN", "PERAN1", lOGIN.ID_PERAN); return(View(lOGIN)); }
public static string modificarPassword(string rut, string passActual, string newPass) { using (EasyLifeEntities dbc = new EasyLifeEntities()) { LOGIN aux = loginPersona(rut, passActual); string passEncripter = Controller.ControllerEncryption.stEncryptionMD5(newPass); string key = ConfigurationManager.AppSettings["stKey"]; string pass3DES = Controller.ControllerEncryption.stEncryption3DES(passEncripter, key); dbc.UpdatePassword(pass3DES, aux.ID_PERSONA); return("Password Cambiada"); } }
public async Task <IHttpActionResult> PostLOGIN(LOGIN lOGIN) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LOGINs.Add(lOGIN); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = lOGIN.ID }, lOGIN)); }