private void btn_Update_Emp_Search_Click(object sender, EventArgs e) { tb_ID.Enabled = false; Con_Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM Employee_Detail_Add WHERE ID = " + tb_ID.Text + "", con); var Obj = cmd.ExecuteReader(); if (Obj.Read()) { MessageBox.Show("Search Successfully...!!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); tb_Name.Text = Obj.GetString(Obj.GetOrdinal("Name")); tb_MobNo.Text = (Obj["MobNo"].ToString()); dtp_DOB.Text = (Obj["DOB"].ToString()); cmb_City.Text = Obj.GetString(Obj.GetOrdinal("City")); Gender = Obj.GetString(Obj.GetOrdinal("Gender")); Qualification = Obj.GetString(Obj.GetOrdinal("Qualification")); Lang = Obj.GetString(Obj.GetOrdinal("KnownLanguage")); bRet = Gender.Contains("Male"); if (bRet) { rbtn_Male.Checked = true; } bRet = Gender.Contains("Female"); if (bRet) { rbtn_Female.Checked = true; } bRet = Qualification.Contains("BCS"); if (bRet) { cb_BCS.Checked = true; } bRet = Qualification.Contains("BCA"); if (bRet) { cb_BCA.Checked = true; } bRet = Qualification.Contains("BSC"); if (bRet) { cb_BSC.Checked = true; } bRet = Qualification.Contains("MSC"); if (bRet) { cb_MSC.Checked = true; } bRet = Qualification.Contains("MScs"); if (bRet) { cb_MScs.Checked = true; } bRet = Qualification.Contains("Engg"); if (bRet) { cb_Engg.Checked = true; } bRet = Lang.Contains("C"); if (bRet) { cb_C.Checked = true; } bRet = Lang.Contains("C++"); if (bRet) { cb_Cpp.Checked = true; } bRet = Lang.Contains("Java"); if (bRet) { cb_Java.Checked = true; } bRet = Lang.Contains("Python"); if (bRet) { cb_Python.Checked = true; } bRet = Lang.Contains("C#"); if (bRet) { cb_CSharp.Checked = true; } bRet = Lang.Contains("VB.Net"); if (bRet) { cb_Vb_Net.Checked = true; } } else { MessageBox.Show("Invalid Id...!!", "Failure", MessageBoxButtons.OK, MessageBoxIcon.Error); tb_ID.Enabled = true; tb_ID.Clear(); tb_ID.Focus(); } btn_Update.Enabled = true; tb_Name.Focus(); Con_Close(); }
private void ExecuteShowReport() { if (SelectedResidenceColumns.Count == 0) { MessageBox.Show("No Columns selected"); Result = null; SearchStatus = String.Empty; return; } Result = new FlowDocument(); List <Residence> input = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { input = unitOfWork.Residences.GetAll().ToList(); String[] temp = null; if (!String.IsNullOrEmpty(Area)) { if (Area.Contains(";")) { temp = Area.Split(';'); } else { temp = new string[1]; temp[0] = Area; } if (temp != null) { input = input.Where(x => temp.Contains(x.Area, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(HouseName)) { temp = null; if (HouseName.Contains(";")) { temp = HouseName.Split(';'); } else { temp = new string[1]; temp[0] = HouseName; } if (temp != null) { input = input.Where(x => temp.Contains(x.Name, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(HouseNumber)) { temp = null; if (HouseNumber.Contains(";")) { temp = HouseNumber.Split(';'); } else { temp = new string[1]; temp[0] = HouseNumber; } if (temp != null) { input = input.Where(x => temp.Contains(x.Number, new ContainsComparer())).ToList(); } } } List <ResidenceMember> members = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { members = unitOfWork.ResidenceMembers.GetAll().ToList(); String[] temp = null; if (!String.IsNullOrEmpty(MarriageStatus)) { if (MarriageStatus.Contains(";")) { temp = MarriageStatus.Split(';'); } else { temp = new string[1]; temp[0] = MarriageStatus; } if (temp != null) { members = members.Where(x => temp.Contains(x.MarriageStatus, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(Country)) { temp = null; if (Country.Contains(";")) { temp = Country.Split(';'); } else { temp = new string[1]; temp[0] = Country; } if (temp != null) { members = members.Where(x => temp.Contains(x.Country, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(Qualification)) { temp = null; if (Qualification.Contains(";")) { temp = Qualification.Split(';'); } else { temp = new string[1]; temp[0] = Qualification; } if (temp != null) { members = members.Where(x => temp.Contains(x.Qualification, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(Gender)) { temp = null; if (Gender.Contains(";")) { temp = Gender.Split(';'); } else { temp = new string[1]; temp[0] = Gender; } if (temp != null) { members = members.Where(x => temp.Contains(x.Gender, new ContainsComparer())).ToList(); } } } if (ValidateReportParameters()) { BuildReport(input, members); } }
public bool IsGender(string partialGenderString, bool ignoreNulls = false) { return((ignoreNulls && string.IsNullOrWhiteSpace(Gender)) || (Gender?.Contains(partialGenderString) ?? false)); }
public bool IsFemale() { return(Gender.Contains("Ж")); }