public static int Login(string username, string password, string server) { // Login : trả về bool, thành công - thất bại // Hoặc tra về errorCode if (DAOAccount.Login(username, password, server)) { return(0); } return(1); }
protected void btnSign_Click(object sender, ImageClickEventArgs e) { try { DAOAccount.Register(txtEmailSign.Text, txtPasswordSign.Text, txtName.Text, txtSDT.Text, txtDiaChi.Text, Convert.ToDateTime(txtDOB.Text)); Response.Write("<script>alert('Đăng kí thành công rồi bạn ơi =))');</script>"); } catch (FormatException ex) { Response.Write("<script>alert('Xay Ra Loi');</script>"); } }
//gold public static long GetTotalGold(bool bForceUpdate) { if (bForceUpdate) { DAOAccount.GoToGoldPage(); DAOAccount.GetTotalGold(); return(Gloval.Database.Account.TotalGold); } else { return(Gloval.Database.Account.TotalGold); } }
public void LogIn() { AccountView.printAccountDetails("Login: "******"Password: "******"\nTry again because Login or Password is wrong!"); Console.WriteLine("Create new acconunt if you don't have."); LogIn(); } else { string CustomerName = customer.FirstName; Console.Write("\n"); Console.WriteLine($"\nHello {CustomerName} in our shop. Now You may buy want You need :)\n"); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { int soAccount = DAOAccount.CheckAccount(txtEmailLog.Text, txtPasswordLog.Text).Rows.Count; if (soAccount == 1) { AccountModel acc = new AccountModel(); txtEmailacc.Text = acc.Email = txtEmailLog.Text; acc.Password = txtPasswordLog.Text; txtNameacc.Text = acc.Ten = DAOAccount.CheckAccount(txtEmailLog.Text, txtPasswordLog.Text).Rows[0]["ten"].ToString(); txtSdtacc.Text = acc.SDT = DAOAccount.CheckAccount(txtEmailLog.Text, txtPasswordLog.Text).Rows[0]["sdt"].ToString(); txtDiaChiacc.Text = acc.DiaChi = DAOAccount.CheckAccount(txtEmailLog.Text, txtPasswordLog.Text).Rows[0]["diachi"].ToString(); txtNgaySinhacc.Text = acc.SinhNhat = DAOAccount.CheckAccount(txtEmailLog.Text, txtPasswordLog.Text).Rows[0]["sinhnhat"].ToString(); Session["accSession"] = acc; btnAccount.ImageUrl = "~/images/person.PNG"; } else { Response.Write("<script>alert('Tên tài khoản hoặc mật khẩu sai!!!');</script>"); } { } }
public static void Logout() { DAOAccount.Logout(); }
public static void AutoLoadDefaultPage() { DAOAccount.GoToGoldPage(); }
//adv statuc public static int CheckAdvStatus() { return(DAOAccount.CheckAdvStatus()); }
public static void AutoLoadDefaultPage() { DAOAccount.GoToGoldPage(); Gloval.Database.CurrentView = Data.SITE_VIEW.GOLD_PAGE; }