//private void AnyPropertyIsnull(DataSet.PersonalRow p) //{ // if (p.strFirstName == null) p.strFirstName = "xxxxxx"; // else if (p.strLastName == null) p.strLastName = "xxxxxx"; // else if (p.strFatherName == null) p.strFatherName = "xxxxxx"; // else if (p.strMatherName == null) p.strMatherName = "xxxxxx"; // else if (p.dteDateOfBirth == null) p.dteDateOfBirth = DateTime.Now; // else if (p.strGender == null) p.strGender = "xxxxxx"; // else if (p.strReligion == null) p.strReligion = "xxxxxx"; // else if (p.strMeritalStutas == null) p.strMeritalStutas = "xxxxxx"; // else if (p.strNational == null) p.strNational = "xxxxxx"; // else if (p.strNID == null) p.strNID = "xxxxxx"; // else if (p.strPassportNo == null) p.strPassportNo = "xxxxxx"; // else if (p.dtePassportIssueDate == null) p.dtePassportIssueDate = DateTime.Now; // else if (p.strMobile1 == null) p.strMobile1 = "xxxxxx"; // else if (p.strMobile2 == null) p.strMobile2 = "xxxxxx"; // else if (p.strMobile3 == null) p.strMobile3 = "xxxxxx"; // else if (p.strMainEmail == null) p.strMainEmail = "xxxxxx"; // else if (p.strAltEmail == null) p.strAltEmail = "xxxxxx"; // else if (p.strPresentAddress == null) p.strPresentAddress = "xxxxxx"; // else if (p.strParmanentAddress == null) p.strParmanentAddress = "xxxxxx"; // else if (p.strObjective == null) p.strObjective = "xxxxxx"; // else if (p.strParmanentAddress2 == null) p.strParmanentAddress2 = "xxxxxx"; // else if (p.floatPresentSalary == null) p.floatPresentSalary = 0; // else if (p.floatExpectedSalary == null) p.floatExpectedSalary = 0; // else if (p.strJobLavel == null) p.strJobLavel = "xxxxxx"; // else if (p.strJobNature == null) p.strJobNature = "xxxxxx"; // else if (p.strCareerSummary == null) p.strCareerSummary = "xxxxxx"; // else if (p.strSpecialQualification == null) p.strSpecialQualification = "xxxxxx"; // else if (p.strKeywords == null) p.strKeywords = "xxxxxx"; //} public string Updatedata(PersonalDetailsClass ap) { string message; int row = aPTA.UpdateQuery(ap.strFirstName, ap.strLastName, ap.strFatherName, ap.strMatherName, ap.dteDateOfBirth.ToString(), ap.strGender, ap.strReligion, ap.strMeritalStutas, ap.strNational, ap.strNID, ap.strPassportNo, ap.dtePassportIssueDate.ToString(), ap.strMobile1, ap.strMobile2, ap.strMobile3, ap.strMainEmail, ap.strAltEmail, ap.strPresentAddress, ap.strParmanentAddress, ap.strObjective, ap.strParmanentAddress2, ap.floatPresentSalary, ap.floatExpectedSalary, ap.strJobLavel, ap.strJobNature, ap.strCareerSummary, ap.strSpecialQualification, ap.strKeywords, ap.imgImage, ap.intID); if (row != null) { message = "Data are successfull Updated."; } else { message = "Sorry! Data are not Updated."; } return(message); }
public List <PersonalDetailsClass> GetPersonalData() { int i = 1; List <PersonalDetailsClass> personalList = new List <PersonalDetailsClass>(); foreach (var p in aPTA.GetData()) { PersonalDetailsClass ap = new PersonalDetailsClass(); //AnyPropertyIsnull(p); ap.intID = p.intID; ap.strFirstName = p.strFirstName; ap.strLastName = p.strLastName; ap.strFatherName = p.strFatherName; ap.strMatherName = p.strMatherName; ap.dteDateOfBirth = p.dteDateOfBirth; ap.strGender = p.strGender; ap.strReligion = p.strReligion; ap.strMeritalStutas = p.strMeritalStutas; ap.strNational = p.strNational; ap.strNID = p.strNID; ap.strPassportNo = p.strPassportNo; ap.dtePassportIssueDate = p.dtePassportIssueDate; ap.strMobile1 = p.strMobile1; ap.strMobile2 = p.strMobile2; ap.strMobile3 = p.strMobile3; ap.strMainEmail = p.strMainEmail; ap.strAltEmail = p.strAltEmail; ap.strPresentAddress = p.strPresentAddress; ap.strParmanentAddress = p.strParmanentAddress; ap.strObjective = p.strObjective; ap.strParmanentAddress2 = p.strParmanentAddress2; ap.floatPresentSalary = (p.floatPresentSalary); ap.floatExpectedSalary = p.floatExpectedSalary; ap.strJobLavel = p.strJobLavel; ap.strJobNature = p.strJobNature; ap.strCareerSummary = p.strCareerSummary; ap.strSpecialQualification = p.strSpecialQualification; ap.strKeywords = p.strKeywords; personalList.Add(ap); i++; } return(personalList); }
private void CreateAddXml(PersonalDetailsClass aPersonal) { XmlDocument doc = new XmlDocument(); if (System.IO.File.Exists(filePathForXML)) { doc.Load(filePathForXML); XmlNode rootNode = doc.SelectSingleNode("People"); XmlNode addItem = CreateItemNodeDocUpload(doc, aPersonal); rootNode.AppendChild(addItem); } else { XmlNode xmldeclerationNode = doc.CreateXmlDeclaration("1.0", "UTF-8", ""); doc.AppendChild(xmldeclerationNode); XmlNode rootNode = doc.CreateElement("People"); XmlNode addItem = CreateItemNodeDocUpload(doc, aPersonal); rootNode.AppendChild(addItem); doc.AppendChild(rootNode); } doc.Save(filePathForXML); //LoadGridwithXml(); }
private XmlNode CreateItemNodeDocUpload(XmlDocument doc, PersonalDetailsClass aPersonal) { XmlNode node = doc.CreateElement("Person"); XmlAttribute FirstName = doc.CreateAttribute("firstName"); FirstName.Value = aPersonal.strFirstName; node.Attributes.Append(FirstName); XmlAttribute LastName = doc.CreateAttribute("lastName"); LastName.Value = aPersonal.strLastName; node.Attributes.Append(LastName); XmlAttribute FatherName = doc.CreateAttribute("fatherName"); FatherName.Value = aPersonal.strFatherName; node.Attributes.Append(FatherName); XmlAttribute MatherName = doc.CreateAttribute("matherName"); MatherName.Value = aPersonal.strMatherName; node.Attributes.Append(MatherName); XmlAttribute DateOfBirth = doc.CreateAttribute("dob"); DateOfBirth.Value = aPersonal.dteDateOfBirth.ToString(); node.Attributes.Append(DateOfBirth); XmlAttribute Gender = doc.CreateAttribute("gender"); Gender.Value = aPersonal.strGender; node.Attributes.Append(Gender); XmlAttribute Religion = doc.CreateAttribute("religion"); Religion.Value = aPersonal.strReligion; node.Attributes.Append(Religion); XmlAttribute MaritalStatus = doc.CreateAttribute("maritalStatus"); MaritalStatus.Value = aPersonal.strMeritalStutas; node.Attributes.Append(MaritalStatus); XmlAttribute Nationality = doc.CreateAttribute("nationality"); Nationality.Value = aPersonal.strNational; node.Attributes.Append(Nationality); XmlAttribute NID = doc.CreateAttribute("nid"); NID.Value = aPersonal.strNID; node.Attributes.Append(NID); XmlAttribute PassportNo = doc.CreateAttribute("passportNo"); PassportNo.Value = aPersonal.strPassportNo; node.Attributes.Append(PassportNo); XmlAttribute PassportIssueDate = doc.CreateAttribute("passportIssueDate"); PassportIssueDate.Value = aPersonal.dtePassportIssueDate.ToString(); node.Attributes.Append(PassportIssueDate); XmlAttribute Mobile1 = doc.CreateAttribute("mobile1"); Mobile1.Value = aPersonal.strMobile1; node.Attributes.Append(Mobile1); XmlAttribute Mobile2 = doc.CreateAttribute("mobile2"); Mobile2.Value = aPersonal.strMobile2; node.Attributes.Append(Mobile2); XmlAttribute Mobile3 = doc.CreateAttribute("mobile3"); Mobile3.Value = aPersonal.strMobile3; node.Attributes.Append(Mobile3); XmlAttribute MainEmail = doc.CreateAttribute("mainEmail"); MainEmail.Value = aPersonal.strMainEmail; node.Attributes.Append(MainEmail); XmlAttribute AltEmail = doc.CreateAttribute("altEmail"); AltEmail.Value = aPersonal.strAltEmail; node.Attributes.Append(AltEmail); XmlAttribute PresentAddress = doc.CreateAttribute("presentAddress"); PresentAddress.Value = aPersonal.strPresentAddress; node.Attributes.Append(PresentAddress); XmlAttribute ParmanentAddress = doc.CreateAttribute("parmanentAddress"); ParmanentAddress.Value = aPersonal.strParmanentAddress; node.Attributes.Append(ParmanentAddress); XmlAttribute Objective = doc.CreateAttribute("objective"); Objective.Value = aPersonal.strObjective; node.Attributes.Append(Objective); XmlAttribute ParmanentAddress2 = doc.CreateAttribute("parmanenetAddress"); ParmanentAddress2.Value = aPersonal.strParmanentAddress2; node.Attributes.Append(ParmanentAddress2); XmlAttribute PresentSalary = doc.CreateAttribute("presentSalary"); PresentSalary.Value = aPersonal.floatPresentSalary.ToString(); node.Attributes.Append(PresentSalary); XmlAttribute ExpectedSalary = doc.CreateAttribute("expectedSalary"); ExpectedSalary.Value = aPersonal.floatExpectedSalary.ToString(); node.Attributes.Append(ExpectedSalary); XmlAttribute JobLevel = doc.CreateAttribute("joblevel"); JobLevel.Value = aPersonal.strJobLavel; node.Attributes.Append(JobLevel); XmlAttribute JobNature = doc.CreateAttribute("jobnature"); JobNature.Value = aPersonal.strJobNature; node.Attributes.Append(JobNature); XmlAttribute CareerSummary = doc.CreateAttribute("careersummary"); CareerSummary.Value = aPersonal.strCareerSummary; node.Attributes.Append(CareerSummary); XmlAttribute SpecialQualification = doc.CreateAttribute("specialqualification"); SpecialQualification.Value = aPersonal.strSpecialQualification; node.Attributes.Append(SpecialQualification); XmlAttribute Keywords = doc.CreateAttribute("keywords"); Keywords.Value = aPersonal.strKeywords; node.Attributes.Append(Keywords); XmlAttribute Image = doc.CreateAttribute("image"); Image.Value = Convert.ToBase64String(aPersonal.imgImage); node.Attributes.Append(Image); return(node); }