public XmlDocument downloadCandidateInforamation(string localBody, string wardno) { try { XmlDocument xmlDocument = new XmlDocument(); DownloadDAL downloadDal = new DownloadDAL(); downloadDal.downloadCandiateInformation(localBody, wardno); if (downloadDal.isError == CommonCode.OK) { if (downloadDal.Data != null && downloadDal.Data.Tables[0].Rows.Count != 0) { downloadDal.Data.Tables[0].TableName = "CandidateInformation"; XmlDataDocument xmlDataDocument = new XmlDataDocument(downloadDal.Data); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(downloadDal.isError)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getdataByWardNo(string localBody, string wardno, string boothNo, int count) { try { XmlDocument xmlDocument = new XmlDocument(); DownloadDAL downloadDal = new DownloadDAL(); downloadDal.downloadVoterList(localBody, wardno, boothNo, count); if (downloadDal.isError == CommonCode.OK) { if (downloadDal.Data != null && downloadDal.Data.Tables[0].Rows.Count != 0) { downloadDal.Data.Tables[0].TableName = "VotersInformation"; XmlDataDocument xmlDataDocument = new XmlDataDocument(downloadDal.Data); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(downloadDal.isError)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getFamilyDetails(string regId) { try { XmlDocument xmlDocument = new XmlDocument(); FamiliesDAL familiesDal = new FamiliesDAL(); familiesDal.getFamilies(regId); if (familiesDal.isError == CommonCode.OK) { if (familiesDal.FamilyData != null && familiesDal.FamilyData.Tables[0].Rows.Count != 0) { familiesDal.FamilyData.Tables[0].TableName = "FamilyDetails"; XmlDataDocument xmlDataDocument = new XmlDataDocument(familiesDal.FamilyData); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(familiesDal.isError)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getQuestions(string id, int type) { try { XmlDocument xmlDocument = new XmlDocument(); SecurityQuestionsDAL securityQuesionsDal = new SecurityQuestionsDAL(); securityQuesionsDal.getQuestions(id, type); if (securityQuesionsDal.isError == CommonCode.OK) { if (securityQuesionsDal.QuestionsData != null && securityQuesionsDal.QuestionsData.Tables[0].Rows.Count != 0) { securityQuesionsDal.QuestionsData.Tables[0].TableName = "Questions"; XmlDataDocument xmlDataDocument = new XmlDataDocument(securityQuesionsDal.QuestionsData); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.FAIL)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.FAIL)); } }
public XmlDocument getLocalBodies(int district, int taluka, int localBodyType) { try { XmlDocument xmlDocument = new XmlDocument(); OthersDAL othersDal = new OthersDAL(); othersDal.getLocalBody(taluka, district, localBodyType); if (othersDal.isError == CommonCode.OK) { if (othersDal.Data != null && othersDal.Data.Tables[0].Rows.Count != 0) { othersDal.Data.Tables[0].TableName = "LocalBodies"; XmlDataDocument xmlDataDocument = new XmlDataDocument(othersDal.Data); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.FAIL)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getDistrict(int stateId) { try { XmlDocument xmlDocument = new XmlDocument(); OthersDAL othersDal = new OthersDAL(); othersDal.getDistrict(stateId); if (othersDal.isError == CommonCode.OK) { if (othersDal.Data != null && othersDal.Data.Tables[0].Rows.Count != 0) { othersDal.Data.Tables[0].TableName = "District"; XmlDataDocument xmlDataDocument = new XmlDataDocument(othersDal.Data); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.DATA_NOT_FOUND)); } } else { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.FAIL)); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument Talukas(int district) { try { OthersBLL othersDll = new OthersBLL(); return(othersDll.getTalukas(district)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument Districts(int state) { try { OthersBLL othersDll = new OthersBLL(); return(othersDll.getDistrict(state)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getVoters(string fName, string lName, string localBody) { try { OthersBLL othersDll = new OthersBLL(); return(othersDll.getVotersNames(fName, lName, localBody)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadDistrict() //Download District Basic Details Call When True voter App Start { try { DownloadBLL downloadBll = new DownloadBLL(); return(downloadBll.downloadDistrictInfo()); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadAssembly() //Download Taluka Call When True voter App Start { try { DownloadBLL downloadBll = new DownloadBLL(); return(downloadBll.downloadAssemblyInfo()); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadCandiateInformation(string localBody, string wardno) { try { DownloadBLL downloadBll = new DownloadBLL(); return(downloadBll.downloadCandidateInforamation(localBody, wardno)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadfromWard(string localBody, string wardno, string boothNo, int count) { try { DownloadBLL downloadBll = new DownloadBLL(); return(downloadBll.getdataByWardNo(localBody, wardno, boothNo, count)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getFamilies(string regid) //change here { try { FamiliesBll familiesBll = new FamiliesBll(); return(familiesBll.getFamilyDetails(regid)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getVotersById(string id) { try { OthersBLL othersDll = new OthersBLL(); return(othersDll.getVotersById(id)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getQuestiions(string id, int type) { try { SequrityQuestionsBLL securityQuesionsBll = new SequrityQuestionsBLL(); return(securityQuesionsBll.getQuestions(id, type)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument LocalBodies(int district, int taluka, int localBodyType) { try { OthersBLL othersDll = new OthersBLL(); return(othersDll.getLocalBodies(district, taluka, localBodyType)); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getVotersNames(string fName, string lName, string localBody) { try { XmlDocument xml = new XmlDocument(); App_Code.DAL.OthersDAL othersDal = new App_Code.DAL.OthersDAL(); System.Data.DataSet ds = othersDal.getVoters(fName, lName, localBody); XmlDataDocument xmldata = new XmlDataDocument(ds); XmlElement element = xmldata.DocumentElement; return(xmldata); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument getVotersById(string id) { try { XmlDocument xml = new XmlDocument(); App_Code.DAL.OthersDAL othersDal = new App_Code.DAL.OthersDAL(); System.Data.DataSet ds = othersDal.getVotersById(id); XmlDataDocument xmlDataDocument = new XmlDataDocument(ds); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadDistrictInfo() { try { XmlDocument xmlDocument = new XmlDocument(); DownloadDAL downloadDal = new DownloadDAL(); downloadDal.downloadDistrictInformation(); downloadDal.Data.Tables[0].TableName = "tblDistrictMapping"; XmlDataDocument xmlDataDocument = new XmlDataDocument(downloadDal.Data); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadElectionMaster() { try { string sql = "select * from [TrueVoterDB].[dbo].[tblElectionMaster](NOLOCK)"; cmd.CommandText = sql; cmd.Connection = con; SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); XmlDataDocument datadocument = new XmlDataDocument(ds); XmlElement xmlele = datadocument.DocumentElement; return(datadocument); } catch (Exception) { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument downloadInfo(string regid) //Want to change here enc dec { try { string sql = "SELECT * FROM [TrueVoterDB].[dbo].[Registrations](NOLOCK) WHERE RegId='" + regid + "'"; cmd.CommandText = sql; cmd.Connection = con; SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); XmlDataDocument datadocument = new XmlDataDocument(ds); XmlElement xmlele = datadocument.DocumentElement; return(datadocument); } catch (Exception) { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument SearchUserByMobile(string mobileNo) { try { string[] uregid = mobileNo.Split('$'); mobileNo = objenc.DecryptInteger(uregid[0], uregid[1]); XmlDocument xmlDocument = new XmlDocument(); SearchBAL searchBal = new SearchBAL(mobileNo); if (searchBal.isValid()) { SearchDAL searchDal = new SearchDAL(); searchDal.SearchUserByMobile(mobileNo); if (searchDal.isError == CommonCode.OK) { if (searchDal.userData != null && searchDal.userData.Tables[0].Rows.Count != 0) { searchDal.userData.Tables[0].TableName = "FamilyDetails"; XmlDataDocument xmlDataDocument = new XmlDataDocument(searchDal.userData); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else if (searchDal.userData.Tables[0].Rows.Count == 0) { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(CommonCode.DATA_NOT_FOUND.ToString())); errrorNode.AppendChild(nameNode); return(doc); } } else { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(Convert.ToString(searchDal.isError))); errrorNode.AppendChild(nameNode); } } else { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(Convert.ToString(CommonCode.WRONG_INPUT))); errrorNode.AppendChild(nameNode); } return(xmlDocument); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument GetProfile(string regId) { XmlDocument xmlDocument = new XmlDocument(); RegistrationDAL registrationDal = new RegistrationDAL(); try { string[] uregid = regId.Split('$'); string substr = uregid[0].Substring(0, 3); string ump = uregid[0].ToString(); int len = ump.Length; len = len - 3; ump = ump.Substring(3, len); regId = objenc.DecryptInteger(ump, uregid[1]); regId = substr + regId; registrationDal.UserProfileData(regId); if (registrationDal.isError == CommonCode.OK) { if (registrationDal.userData != null && registrationDal.userData.Tables[0].Rows.Count != 0) { registrationDal.userData.Tables[0].TableName = "UserProfile"; XmlDataDocument xmlDataDocument = new XmlDataDocument(registrationDal.userData); XmlElement element = xmlDataDocument.DocumentElement; return(xmlDataDocument); } else if (registrationDal.userData.Tables[0].Rows.Count == 0) { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(CommonCode.DATA_NOT_FOUND.ToString())); errrorNode.AppendChild(nameNode); return(doc); } } else { XmlDocument doc = new XmlDocument(); XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null); doc.AppendChild(docNode); XmlNode errrorNode = doc.CreateElement("ErrorMainNode"); doc.AppendChild(errrorNode); XmlNode nameNode = doc.CreateElement("Error"); nameNode.AppendChild(doc.CreateTextNode(Convert.ToString(registrationDal.isError))); errrorNode.AppendChild(nameNode); } return(xmlDocument); } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }
public XmlDocument Login(string Password, string MobileNo, string imeiNumber) //Change made 09.11.2016 { try { XmlDataDocument xmldata = new XmlDataDocument(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); CommonCode cc = new CommonCode(); string sqlQuery = string.Empty; MobileNo = EncryptDecrypt.DecodeAndDecrypt(MobileNo); Password = EncryptDecrypt.DecodeAndDecrypt(Password); string pw = Password.Substring(0, Password.Length - 12); Password = cc.DESEncrypt(pw); string dt1 = MobileNo.Substring(MobileNo.Length - 12); MobileNo = MobileNo.Substring(0, MobileNo.Length - 12); string retVal = objenc.DateTimeDec(dt1); //retVal = "1"; if (retVal == "0") { dt.Columns.Add(new DataColumn("NoRecord", typeof(int))); DataRow dr = dt.NewRow(); dr["NoRecord"] = "105"; dt.Rows.Add(dr); DataSet ds3 = new DataSet(); ds3.Tables.Add(dt); ds3.Tables[0].TableName = "NO"; xmldata = new XmlDataDocument(ds3); XmlElement xmlelement = xmldata.DocumentElement; return(xmldata); } //if (imeiNumber == "") //{ // sqlQuery = "SELECT [UserType] AS [typeOfUse_Id] " + // "FROM [TrueVoterDB].[dbo].[Logins] WHERE [UserName]='" + MobileNo + "' AND [Password]='" + Password + "'"; //} //else //{ sqlQuery = "SELECT [UserType] AS [typeOfUse_Id] " + "FROM [TrueVoterDB].[dbo].[Logins](NOLOCK) WHERE [UserName]='" + MobileNo + "' AND [Password]='" + Password + "' AND [ImeiNumber] = '" + imeiNumber + "'"; // } ds = cc.ExecuteDataset(sqlQuery); if (ds.Tables[0].Rows.Count > 0) { string roleId = ds.Tables[0].Rows[0]["typeOfUse_Id"].ToString(); if (roleId == "2") { sqlQuery = "SELECT [keyword]='TRUEVOTER',[ImeiNumber] AS [strDevId],[strSimSerialno] AS [strSimSerialNo],[Name] AS [firstName],[LName] AS [lastName],'0' AS [firmName], [MobileNo] AS [mobileNo], [address],[EmailId] AS [eMailId],[UserType] AS [typeOfUse_Id],[RefMobileNo] AS [RefMobileNo],[State],[District],[Taluka],[LATITUTE] AS [latitude],[LAGITUTE] AS [longitude] " + ",[IsApproved]=0,[usrMobileNumber],[DesignationId],[DesignationName],[LokingAfterId],[LokingAfterName],[LocalBodyId],[LocalBodyName],[refMobileNumber],[OfficerDistrictId],[Post],[AllocatedWard] " + "FROM [TrueVoterDB].[dbo].[Logins] INNER JOIN [TrueVoterDB].[dbo].[tblNewDataRegExtra] " + "ON [TrueVoterDB].[dbo].[Logins].[UserName] = [TrueVoterDB].[dbo].[tblNewDataRegExtra].[usrMobileNumber] WHERE [UserName]='" + MobileNo + "' AND [Password]='" + Password + "'"; } else { sqlQuery = "SELECT [keyword]='TRUEVOTER',[ImeiNumber] AS [strDevId],[strSimSerialno] AS [strSimSerialNo],[Name] AS [firstName],[LName] AS [lastName],'0' AS [firmName], " + "[MobileNo] AS [mobileNo], [address],[EmailId] AS [eMailId],[UserType] AS [typeOfUse_Id],[RefMobileNo] AS [RefMobileNo], " + "[State],[District],[Taluka],[LATITUTE] AS [latitude], [LAGITUTE] AS [longitude],[IsApproved]=0,[usrMobileNumber],[CandidateRole],[CandidateRoleName],[CandidateDistrictID], " + "[LocalBodyType] AS CandiLocalBodyType,[LocalBodyName] As CandiLocalBodyName,[WardNo] As CandiWard,[LocalBodyID] As CandiLocalBodyId,[AssemblyID] As CandiAssemblyId " + "FROM [TrueVoterDB].[dbo].[Logins] INNER JOIN [TrueVoterDB].[dbo].[tblNewDataCandi_Reg] " + "ON [TrueVoterDB].[dbo].[Logins].[UserName] = [TrueVoterDB].[dbo].[tblNewDataCandi_Reg].[usrMobileNumber] " + "WHERE [UserName]='" + MobileNo + "' AND [Password]='" + Password + "' AND [ImeiNumber] = '" + imeiNumber + "'"; } //if (imeiNumber != "") //{ DataSet dsWholeData = cc.ExecuteDataset(sqlQuery); xmldata = new XmlDataDocument(dsWholeData); //} //else //{ // xmldata = new XmlDataDocument(ds); //} XmlElement xmlele = xmldata.DocumentElement; return(xmldata); } else { dt.Columns.Add(new DataColumn("NoRecord", typeof(int))); DataRow dr = dt.NewRow(); dr["NoRecord"] = "105"; dt.Rows.Add(dr); DataSet ds3 = new DataSet(); ds3.Tables.Add(dt); ds3.Tables[0].TableName = "NO"; xmldata = new XmlDataDocument(ds3); XmlElement xmlelement = xmldata.DocumentElement; return(xmldata); } } catch { CommonCode commonCode = new CommonCode(); return(commonCode.ErrorXml(CommonCode.SQL_ERROR)); } }