protected void FillCombo() { DataTable dt = new UsersBAL().FillCombo(); cmb_EventId.Items.Insert(0, "Select Any"); cmb_EventId.SelectedIndex = 0; foreach (DataRow dr in dt.Rows) { cmb_EventId.Items.Add(dr["EventId"].ToString()); } }
private void btn_Login_Click(object sender, EventArgs e) { if (CheckValidation()) { try { wrap = new Wrapper(); if (cmb_EventId.Text != "Select Any" && cmb_EventId.Text != string.Empty && cmb_EventId.Text != null) { res = new UsersBAL().ExistUser(new string[] { txt_UserName.Text.Trim(), Global.EncryptedPassword(txt_Password.Text.Trim()), "Xhibitor", cmb_EventId.Text }); if (res) { int id = GetUserId(txt_UserName.Text.Trim()); Global.UserId = id.ToString(); Global.UserName = txt_UserName.Text.Trim(); this.Close(); frm_Search frm = new frm_Search(); frm.MdiParent = this.MdiParent; frm.Show(); } else { FormCustomization_Sample.MessageBox.Show("Please Check UserName and Password !!!", Global.MsgInfo, MessageBoxStyle.Errorr); txt_UserName.Focus(); Clear(); } } else { res = new UsersBAL().ExistUser(new string[] { txt_UserName.Text.Trim(), Global.EncryptedPassword(txt_Password.Text.Trim()), "Authorised", null }); if (res) { int id = GetUserId(txt_UserName.Text.Trim()); Global.UserId = id.ToString(); Global.UserName = txt_UserName.Text.Trim(); this.Close(); frm_UserSetup frm = new frm_UserSetup(); frm.MdiParent = this.MdiParent; frm.Show(); } else { FormCustomization_Sample.MessageBox.Show("Please Check UserName and Password !!!", Global.MsgInfo, MessageBoxStyle.Errorr); txt_UserName.Focus(); Clear(); } } } catch (Exception ex) { FormCustomization_Sample.MessageBox.Show(ex.Message, Global.MsgInfo, MessageBoxStyle.Errorr); } } }
public int Update_Password(User user) { UsersBAL usersBal = new UsersBAL(); return usersBal.Update_PasswordBAL(user); }
public int Update_Info(User user) { UsersBAL usersBal = new UsersBAL(); return usersBal.Update_InfoBAL(user); }
public int Update_Users(User u) { UsersBAL usersBal = new UsersBAL(); return usersBal.Update_UsersBAL(u); }
public int Search_Username(User user) { UsersBAL usersBal = new UsersBAL(); return usersBal.Search_UsernameBAL(user); }
public Get_User_By_UserName_v2_Result Get_User_By_UserName_v2(string username) { UsersBAL usersBal = new UsersBAL(); return usersBal.Get_User_By_UserNameBAL(username); }
public int Delete_Users(string username) { UsersBAL usersBal = new UsersBAL(); return usersBal.Delete_UsersBAL(username); }
public int Add_Users(User u) { UsersBAL usersBal = new UsersBAL(); return usersBal.Add_UsersBAL(u); }
private void SearchData(string username) { DataTable dt = new UsersBAL().LoadAll(username); BindData(dt); }
private void SaveData() { Hashtable _ht = new Hashtable(); try { if (CheckFormValidation()) { if (_strActionType == "Add") { _ht = new UsersBAL().Add(new string[]{txt_UserName.Text.Trim(),Global.EncryptedPassword(txt_Password.Text.Trim()), cmb_EventId.Text, cmb_UserType.Text, null, Global.UserId}); if (_ht["p_flg"].ToString() == "1") { FormCustomization_Sample.MessageBox.Show("Saved Successfully", Global.MsgInfo, MessageBoxStyle.Information); return; } } else if (_strActionType == "Edit") { _ht = new UsersBAL().Update(new string[]{txt_UserName.Text.Trim(),Global.EncryptedPassword(txt_Password.Text.Trim()), cmb_EventId.Text, cmb_UserType.Text, null, Global.UserId,lblUserId.Text} ); if (_ht["p_flg"].ToString() == "1") { FormCustomization_Sample.MessageBox.Show("Updated Successfully", Global.MsgInfo, MessageBoxStyle.Information); return; } } } } catch (Exception ex) { throw new Exception(ex.Message); } }
private void LoadData() { DataTable Dt = new UsersBAL().LoadAll(); BindData(Dt); }
private void DeleteRecord(int? id = null) { Hashtable _ht = new Hashtable(); _ht = new UsersBAL().Delete(id); if (_ht["p_flg"].ToString() == "1") { FormCustomization_Sample.MessageBox.Show("Record Deleted Successfully", Global.MsgInfo, MessageBoxStyle.Information); return; } }