protected void Page_Load(object sender, EventArgs e) { u = (use)Session["use"]; if (u == null) { Label1.Text = ""; Button1.Text = "Đăng Nhập"; } else { Button1.Text = "Đăng Xuất"; Label1.Text = u.Getname(); } }
protected void danhnhap(object sender, EventArgs e) { if (u != null) { u = null; Session.Clear(); Page_Load(sender, e); Response.Redirect("Default.aspx"); } else { Response.Redirect("Login.aspx"); } }
public IHttpActionResult GetClientes1(string id) { Usuarios usuario = db.Usuarios.Find(id); if (usuario == null) { return(NotFound()); } use c = new use(); c.Usuario = usuario.Usuario; c.Password = usuario.Password; return(Ok(c)); }
public ActionResult onOroffBugType() { #region 启用/停用类型 int id = int.Parse(Request.Params["id"]); bool state = true; string type = ""; ps_systemconfig result = (from a in medc.ps_systemconfig where a.id == id select a).FirstOrDefault(); try { if (result.isStart == 1) { type = "停用"; result.isStart = 0; } else { type = "启用"; result.isStart = 1; } medc.SubmitChanges(); } catch (Exception) { state = false; } use u = new use() { type = type, succ = state }; #endregion return(Json(u)); }
public alter edit_user_matkhau([FromBody] use us) { alter al = new alter(); try { using (sql_NCKHContext db = new sql_NCKHContext()) { User d = db.Users.SingleOrDefault(x => x.Taikhoan.IndexOf(us.Taikhoan) >= 0 && x.Matkhau.IndexOf(us.Matkhaucu) >= 0); if (d == null) { al.ketqua = false; al.thongbao = "Khách hàng không tồn tại"; } else { if (d.Matkhau.IndexOf(us.Matkhau) >= 0) { al.ketqua = false; al.thongbao = "Mật khẩu cũ và mật khẩu mới trùng, xin đổi mật khẩu khác"; } al.ketqua = true; al.thongbao = "Đổi mật khẩu thành công"; d.Matkhau = us.Matkhau; db.SaveChanges(); } } return(al); } catch (Exception ex) { al.ketqua = true; al.thongbao = ex.Message; return(al); } }