public List <DomesticImmovableAssets> GetAllDomesticImmovableAssets(int qid) { List <DomesticImmovableAssets> aInfo = new List <DomesticImmovableAssets>(); Query = "SELECT * FROM DomesticImmovableAssets WHERE BasicInformationOfAffectedPersonNid='" + qid + "'"; Connection.Open(); Command.CommandText = Query; Reader = Command.ExecuteReader(); while (Reader.Read()) { long id = Convert.ToInt64(Reader["BasicInformationOfAffectedPersonNid"]); string education = Reader["SocioEconomicData"].ToString(); int name = Convert.ToInt32(Reader["AmountOwn"]); int relation = Convert.ToInt32(Reader["Lease"]); int age = Convert.ToInt32(Reader["TentativeAmount"]); int gender = Convert.ToInt32(Reader["TotalProducedAmount"]); DomesticImmovableAssets aData = new DomesticImmovableAssets(); aData.BasicInformationOfAffectedPersonNid = id; aData.SocioEconomicData = education; aData.AmountOwn = name; aData.Lease = relation; aData.TentativeAmount = age; aData.TotalProducedAmount = gender; aInfo.Add(aData); } Connection.Close(); return(aInfo); }
public int SaveDomesticImmovableAssets(DomesticImmovableAssets aData) { //double total = aData.ClothExpenditure + aData.FoodExpenditure + aData.ResidenceRepairingExpenditure + aData.MedicalExpenditure + aData.EducationalExpenditure + aData.CommunicationExpenditure + aData.Miscellaneous; Query = @"INSERT INTO DomesticImmovableAssets(BasicInformationOfAffectedPersonNid,SocioEconomicData,AmountOwn,Lease,TentativeAmount,TotalProducedAmount) VALUES('" + aData.BasicInformationOfAffectedPersonNid + "','" + aData.SocioEconomicData + "','" + aData.AmountOwn + "','" + aData.Lease + "','" + aData.TentativeAmount + "','" + aData.TotalProducedAmount + "')"; Connection.Open(); Command.CommandText = Query; int isRowAffected = Command.ExecuteNonQuery(); Connection.Close(); return(isRowAffected); }
public int SaveDomesticImmovableAssets(DomesticImmovableAssets aData) { return(aFamilyGateway.SaveDomesticImmovableAssets(aData)); }