private bool CheckUserPassword() { BE_LoginUser PasswordCheckObj = new BE_LoginUser(); BP_LoginUser PasswordObj = new BP_LoginUser(); PasswordCheckObj.UserName = txtUserName.Text; PasswordCheckObj.Password = txtPassword.Text; PasswordCheck = PasswordObj.CheckUserPassword(PasswordCheckObj); return(PasswordCheck); }
//public DataTable GetUserDetail(BE_LoginUser DetailObj) //{ // DataTable dt = new DataTable(); // try // { // SqlConnection sqlconn = new SqlConnection(ConnString); // SqlCommand sqlcomm = new SqlCommand("Select UserID,UserStatus,IsActive From Users Where UserName like '%" + DetailObj.UserName + "%'", sqlconn); // dt = GetdataTable(sqlcomm, sqlconn); // } // catch (Exception ex) // { // MessageBox.Show(ex.Message,"Easy Rashan Management System",MessageBoxButtons.OK,MessageBoxIcon.Stop ); // } // return dt; //} public DataTable GetUserDetail(BE_LoginUser NewBEObj) { DataTable dt = new DataTable(); try { string Qry = @"Select * from Def_UserRights A inner join Users B ON A.UserID = B.UserID Where B.UserName Like '%" + NewBEObj.UserName + "%' and CanView=1"; SqlConnection sqlconn = new SqlConnection(ConnString); SqlCommand sqlcomm = new SqlCommand(Qry, sqlconn); dt = GetdataTable(sqlcomm, sqlconn); } catch (Exception ex) { MessageBox.Show(ex.Message, DataAccess.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop); } return(dt); }
private void SetUsers() { BE_LoginUser NewLoginObj = new BE_LoginUser(); //GlobalVaribles gblVar = new GlobalVaribles(); BP_LoginUser GlobalBPObj = new BP_LoginUser(); NewLoginObj.UserName = txtUserName.Text; //gblVar.Style = cboStyles.Text; DataTable dt = new DataTable(); dt = GlobalBPObj.GetUserDetail(NewLoginObj); if (dt.Rows.Count > 0) { GlobalVaribles.UserID = Convert.ToInt32(dt.Rows[0]["UserID"]); GlobalVaribles.UserStatus = dt.Rows[0]["UserStatus"].ToString(); GlobalVaribles.UserName = dt.Rows[0]["UserName"].ToString(); //txtUserID.Text = GlobalVaribles.UserID.ToString(); GlobalVaribles.dtSetUser = dt.Copy(); SetMenu(GlobalVaribles.UserID); } }
//string ConnString = @"Data Source=RGYOUHANAABAD\SQLEXPRESS;Initial Catalog=RashanGhar;User id=sa;password=iloveyoumuhammad786"; //string ConnString = @"Data Source=JAWAD-PC\FAHAD;Initial Catalog=RashanGhar;user id=sa;password=12345;"; //string ConnString = "Data Source=FAHAD;Initial Catalog=RashanGharGreenTown;User id=sa;password=123456"; //string ConnString = "Data Source=192.168.3.90;Initial Catalog=RashanGharLatest;User id=sa;password=123"; public bool CheckUserPassword(BE_LoginUser NewLoginObj) { bool PassswordCheck = false; try { //if (DateTime.Now < Convert.ToDateTime("2018-01-31")) //{ SqlConnection sqlconn = new SqlConnection(ConnString); //SqlCommand sqlcomm = new SqlCommand("Select Password From Users Where UserName like '%"+NewLoginObj.UserName+"%' And Status=1", sqlconn); SqlCommand sqlcomm = new SqlCommand("Select Password From Users Where UserName='******' And Status=1", sqlconn); DataTable dt = new DataTable(); dt = GetdataTable(sqlcomm, sqlconn); if (dt.Rows.Count > 0 && dt != null) { if (dt.Rows[0]["Password"].ToString() == NewLoginObj.Password) { PassswordCheck = true; } else { PassswordCheck = false; } } //} //else //{ // MessageBox.Show("SQL DB Error","Easy Rashan Management System",MessageBoxButtons.OK,MessageBoxIcon.Stop); // return false; //} } catch (Exception ex) { MessageBox.Show(ex.Message, DataAccess.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } return(PassswordCheck); }
public DataTable GetUserDetail(BE_LoginUser DetailObj) { DAL_LoginUser NewDalObj = new DAL_LoginUser(); return(NewDalObj.GetUserDetail(DetailObj)); }
public bool CheckUserPassword(BE_LoginUser BEObj) { DAL_LoginUser NewDAlObj = new DAL_LoginUser(); return(NewDAlObj.CheckUserPassword(BEObj)); }