public IList<PackagesInfo> GetPackageDetailsBYUID(string UID) { IList<PackagesInfo> PackagesList = new List<PackagesInfo>(); try { string spNameString = string.Empty; IDataReader PackagesInfoReader = null; Database dbDatabase = DatabaseFactory.CreateDatabase(Global.INSTANCE_NAME); spNameString = "[USP_MobileGetPackageDetailsByUserID]"; DbCommand dbCommand = null; dbCommand = dbDatabase.GetStoredProcCommand(spNameString); // dbDatabase.AddInParameter(dbCommand, "@UName", System.Data.DbType.String, UsersID); dbDatabase.AddInParameter(dbCommand, "@UId", System.Data.DbType.Int32, UID); PackagesInfoReader = dbDatabase.ExecuteReader(dbCommand); while (PackagesInfoReader.Read()) { //Assign values to the MakesInfo object list PackagesInfo ObjPackageInfo = new PackagesInfo(); AssignPackagesInfo(PackagesInfoReader, ObjPackageInfo); PackagesList.Add(ObjPackageInfo); } } catch (Exception ex) { throw ex; } return PackagesList; }
public List<CarsInfo.PackagesInfo> GetPackageDetailsByUID(string UID, string AuthenticationID, string CustomerID,string SessionID) { List<CarsInfo.PackagesInfo> objPackagesInfo = new List<CarsInfo.PackagesInfo>(); MobileBL objMobileBL = new MobileBL(); try { if (CustomerID.Trim() != "") { DataSet dsSaveCustInfo = objMobileBL.SaveMobileCustomerInfo("GetPackageDetailsByUID", CustomerID, AuthenticationID,UID); } bool bnew = objMobileBL.CheckMobileAuthorizeUSer(SessionID, Convert.ToInt32(UID)); if (bnew) { if (AuthenticationID == ConfigurationManager.AppSettings["AppleID"].ToString()) { objPackagesInfo = (List<CarsInfo.PackagesInfo>)objMobileBL.GetPackageDetailsBYUID(UID); } } else { PackagesInfo objPack = new PackagesInfo(); objPack.AASuccess = "Session timed out"; objPackagesInfo.Add(objPack); } } catch (Exception ex) { } return objPackagesInfo; }
private void AssignPackagesInfo(IDataReader PackagesInfoReader, PackagesInfo ObjPackageInfo) { try { ObjPackageInfo.AASuccess = "Success"; ObjPackageInfo.CarsCount = PackagesInfoReader["CarsCount"].ToString() == "" ? "Emp" : PackagesInfoReader["CarsCount"].ToString(); ObjPackageInfo.CreatedDate = PackagesInfoReader["CreateDate"].ToString() == "" ? "Emp" : PackagesInfoReader["CreateDate"].ToString(); ObjPackageInfo.Description = PackagesInfoReader["Description"].ToString() == "" ? "Emp" : PackagesInfoReader["Description"].ToString(); ObjPackageInfo.MaxCars = PackagesInfoReader["Maxcars"].ToString() == "" ? "Emp" : PackagesInfoReader["Maxcars"].ToString(); ObjPackageInfo.MaxPhotos = PackagesInfoReader["Maxphotos"].ToString() == "" ? "Emp" : PackagesInfoReader["Maxphotos"].ToString(); ObjPackageInfo.PackageID = PackagesInfoReader["PackageID"].ToString() == "" ? "Emp" : PackagesInfoReader["PackageID"].ToString(); ObjPackageInfo.PayDate = PackagesInfoReader["PayDate"].ToString() == "" ? "Emp" : PackagesInfoReader["PayDate"].ToString(); ObjPackageInfo.PDDate = PackagesInfoReader["PDDate"].ToString() == "" ? "Emp" : PackagesInfoReader["PDDate"].ToString(); ObjPackageInfo.Price = PackagesInfoReader["Price"].ToString() == "" ? "Emp" : PackagesInfoReader["Price"].ToString(); ObjPackageInfo.ProcessingFee = PackagesInfoReader["ProcessingFee"].ToString() == "" ? "Emp" : PackagesInfoReader["ProcessingFee"].ToString(); ObjPackageInfo.UID = PackagesInfoReader["UID"].ToString() == "" ? "Emp" : PackagesInfoReader["UID"].ToString(); ObjPackageInfo.UserPackID = PackagesInfoReader["UserPackID"].ToString() == "" ? "Emp" : PackagesInfoReader["UserPackID"].ToString(); ObjPackageInfo.ValidityPeriod = PackagesInfoReader["ValidityPeriod"].ToString() == "" ? "Emp" : PackagesInfoReader["ValidityPeriod"].ToString(); } catch (Exception ex) { } }