private void usertxt_LostFocus(object sender, RoutedEventArgs e) { R.REG_UserName = usertxt.Text; DataTable DT = R.user(); if (DT.Rows.Count == 0) { } else { btnsave.Content = "Update"; nametxt.Text = DT.Rows[0]["REG_Name"].ToString(); phonetxt.Text = DT.Rows[0]["REG_Phone"].ToString(); passwordtxt.Password = DT.Rows[0]["REG_Password"].ToString(); repasswordtxt.Password = DT.Rows[0]["REG_RePassword"].ToString(); if (DT.Rows[0]["DESIGNATION"].ToString() == "1") { rbadmin.IsChecked = true; } else if (DT.Rows[0]["DESIGNATION"].ToString() == "0") { rbuser.IsChecked = true; } } }
public Main() { InitializeComponent(); DataTable dt = h.get(); if (dt.Rows.Count == 0) { txtblock.Text = ""; Hotel_Name = ""; } else { txtblock.Text = Convert.ToString(dt.Rows[0]["NAME"]); Hotel_Name = txtblock.Text; } DataTable D = r.user(); user.Text = login.u; }
public void TXTUSERNAME_LostFocus(object sender, RoutedEventArgs e) { if (TXTUSERNAME.Text != "") { mf_popup.IsOpen = false; try { rd.USERNAME = TXTUSERNAME.Text; rd.PASSWORD = TXTPASSWORD.Password; //rd.user() DataTable DT = rd.user(); if (DT.Rows.Count == 0) { MessageBox.Show("User dosenot exist"); TXTUSERNAME.Text = ""; U = false; } else if (DT.Rows[0]["USER_NAME"].ToString().Equals(TXTUSERNAME.Text.ToUpper())) { //username given small also converting uppercase value in database u = TXTUSERNAME.Text.ToUpper(); dispusername = DT.Rows[0]["USER_NAME"].ToString(); U = true; } //U = true; } catch (Exception) { MessageBox.Show("please Check the username"); } } else { mf_popup.IsOpen = true; } }