//AT LEAST ONE USER EXIST OR NOT CHECK private void LoginUserAllAvailableCheck() { try { objUserLogic = new UserClassBLL(); DataSet ds = new DataSet(); ds = (DataSet)objUserLogic.CurrentUser(lblUserProfile.Text); string secQue = ds.Tables["Table_User"].Rows[0].Field <string>("sec_question"); string secAns = ds.Tables["Table_User"].Rows[0].Field <string>("sec_answer"); string mobile = ds.Tables["Table_User"].Rows[0].Field <string>("mobile"); string division = ds.Tables["Table_User"].Rows[0].Field <string>("division"); lblCommenDetails.Text = division;//CURRENT USER DIVISION if (string.IsNullOrEmpty(secQue) || string.IsNullOrEmpty(secAns) || string.IsNullOrEmpty(mobile) || string.IsNullOrEmpty(division)) { frmUser frmUs = new frmUser(); frmUs.ShowDialog(); MessageBox.Show("You must filling all of details.", "User Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } //SET CURRENT USERNAME AND DIVISION //objUcSurveyor = new ucSurveyor(); //objUcSurveyor.PassValue(lblUserProfile.Text, division); } catch (Exception ex) { MessageBox.Show(ex.Message, "User Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//IF NOT USER OPEN USER REGISTERATION WINDOW private void UserNotExist() { try { objUserLogic = new UserClassBLL(); DataSet ds = new DataSet(); ds = (DataSet)objUserLogic.LoadUserData(); DataTable dt = ds.Tables["Table_User"]; if (dt.Rows.Count == 0) { frmUser frmObjUser = new frmUser(); frmObjUser.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "User Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }