protected void btnLogin_Click(object sender, EventArgs e) { //string pass = txtPassWord.Text.Trim(); string pass = objMyEncryptor.Encrypt(txtPassword.Text.Trim()); boclient.Login_id = txtUserName.Text.Trim(); boclient.Password = pass; DTabLogin = BLUserAccess.UserId(boclient); if (DTabLogin.Rows.Count == 1) { pin_num = int.Parse(DTabLogin.Rows[0][0].ToString()); Session.Add(SessionInfo.pin_number, DTabLogin.Rows[0][0].ToString()); Session.Add(SessionInfo.user_name, DTabLogin.Rows[0][1].ToString()); Session.Add(SessionInfo.loginid, DTabLogin.Rows[0][2].ToString()); Session.Add(SessionInfo.UserType, DTabLogin.Rows[0][4].ToString()); //Session.Add(SessionInfo.ClientIP, GetUserIP()); Session.Add(SessionInfo.ClientIP, "192.1.1.0"); //Session.Add(SessionInfo.EmployeeID, DTabLogin.Rows[0][5].ToString()); //Session.Add(SessionInfo.StoreID, DTabLogin.Rows[0][6].ToString()); //Session.Add(SessionInfo.CompanyName, DTabLogin.Rows[0][7].ToString()); Response.Redirect("~/MainDashboard.aspx"); } else { LoginMsg.Text = "Invalid User Id Or Password"; } }
protected void radCmboUserName_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { try { DataTable dataTable = BLUserAccess.GetAllUsers(); foreach (DataRow dataRow in dataTable.Rows) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = (string)dataRow["name"]; String ContactNumber = dataRow["ContactNumber"].ToString(); item.Attributes.Add("ContactNumber", ContactNumber.ToString()); String email = dataRow["email"].ToString(); item.Attributes.Add("email", email.ToString()); item.Value = dataRow["pin_number"].ToString(); String pin_number = dataRow["pin_number"].ToString(); item.Attributes.Add("pin_number", pin_number.ToString()); radCmboUserName.Items.Add(item); item.DataBind(); } } catch (Exception ex) { Alert.Show(ex.Message); } }