//GetByUserIdDtlPostingId public ResponseSingleModel <BiddingProfile> GetBiddingDetailByUserIddtlPostingId(long UserId, long dtlPostingid) { var response = new ResponseSingleModel <BiddingProfile>(); var ds = this.instanceBidding.GetByUserIdDtlPostingId(UserId, dtlPostingid); BiddingProfile biddingProfile; if (ds.Tables[0].Rows.Count > 0) { biddingProfile = DataAccessUtility.ConvertToList <BiddingProfile>(ds.Tables[0])[0]; if (ds.Tables[1].Rows.Count > 0) { biddingProfile.biddingDetails = DataAccessUtility.ConvertToList <BiddingDetails>(ds.Tables[1]); } else { biddingProfile.biddingDetails = null; } } else { biddingProfile = null; } response.Response = biddingProfile; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <PostingDetails> PostingDetailCreation(PostingDetails postingDetails, out string message) { var result = new ResponseSingleModel <PostingDetails>(); long dtlpostingid; message = string.Empty; if (this.instance.InsertUpdatePostingDetails(postingDetails, out dtlpostingid, out message)) { var ds = this.instance.GetByPostingDetailsId(postingDetails.postingid, out message); var dsPhotos = this.instance.GetByPostingPhotosById(postingDetails.postingid, out message); var lstProfile = DataAccessUtility.ConvertToList <QTrans.Models.ViewModel.Posting.PostingProfileView>(ds.Tables[0]); var lstDetails = DataAccessUtility.ConvertToList <PostingDetails>(ds.Tables[1]); var lstPostingPhotos = DataAccessUtility.ConvertToList <PostingPhotos>(dsPhotos.Tables[0]); postingDetails = lstDetails.Count > 0 ? lstDetails[0] : null; postingDetails.postingProfile = lstProfile.Count > 0 ? lstProfile[0] : null; postingDetails.dtlpostingid = dtlpostingid; postingDetails.PostingPhotoList = lstPostingPhotos; result.Response = postingDetails; result.Status = Constants.WebApiStatusOk; result.Message = message; } else { result.Status = Constants.WebApiStatusFail; result.Message = message; } return(result); }
public ResponseCollectionModel <PackageType> GetPackageType() { var response = new ResponseCollectionModel <PackageType>(); if (InMemoryStorage.Instance.PackageTypeStorage.Count > 0) { var lst = InMemoryStorage.Instance.PackageTypeStorage.Values.ToList(); response.Response = lst; } else { var data = instance.GetPackageType(); var lst = DataAccessUtility.ConvertToList <PackageType>(data); response.Response = lst; foreach (var item in lst) { if (InMemoryStorage.Instance.PackageTypeStorage.Keys.Contains(item.packagetypeid)) { InMemoryStorage.Instance.PackageTypeStorage.AddOrUpdate(item.packagetypeid, item, (key, oldValue) => item); } else { InMemoryStorage.Instance.PackageTypeStorage.TryAdd(item.packagetypeid, item); } } } response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <UserVehicle> GetVehicleByMobile(string mobilenumber) { var response = new ResponseSingleModel <UserVehicle>(); var ds = this.instance.GetByMobile(mobilenumber); UserVehicle userVehicle; if (ds.Tables[0].Rows.Count > 0) { userVehicle = DataAccessUtility.ConvertToList <UserVehicle>(ds.Tables[0])[0]; if (ds.Tables[1].Rows.Count > 0) { userVehicle.vehicles = DataAccessUtility.ConvertToList <Vehicle>(ds.Tables[1]); } else { userVehicle.vehicles = null; } } else { userVehicle = null; } response.Response = userVehicle; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseCollectionModel <PostStatusList> GetPostingStatusByUserId(long userId, Int16 PostStatus) { var result = new ResponseCollectionModel <PostStatusList>(); var dt = this.instance.GetPostingStatusByUserId(userId, PostStatus); result.Response = DataAccessUtility.ConvertToList <PostStatusList>(dt); result.Status = Constants.WebApiStatusOk; return(result); }
public ResponseCollectionModel <Rating> PendingPostRatingByUserId(long userId) { var result = new ResponseCollectionModel <Rating>(); var dt = this.instance.PendingPostRatingByUserId(userId); result.Response = DataAccessUtility.ConvertToList <Rating>(dt); result.Status = Constants.WebApiStatusOk; return(result); }
public ResponseCollectionModel <TransportType> GetTransportType() { var result = new ResponseCollectionModel <TransportType>(); var data = instance.GetTransportType(); result.Response = DataAccessUtility.ConvertToList <TransportType>(data); result.Status = Constants.WebApiStatusOk; return(result); }
public ResponseCollectionModel <AreaPreference> GetAreaPeferenceByUserId(long userId) { var response = new ResponseCollectionModel <AreaPreference>(); var data = instance.GetAreaPeferenceByUserId(userId); response.Response = DataAccessUtility.ConvertToList <AreaPreference>(data); response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseCollectionModel <PostStats> GetBiddingStatsByUserId(long userId) { var dt = this.instanceBidding.GetBiddingStatsByUserId(userId); var result = new ResponseCollectionModel <PostStats>(); result.Response = DataAccessUtility.ConvertToList <PostStats>(dt);; result.Status = Constants.WebApiStatusOk; return(result); }
public ResponseCollectionModel <OrderList> GetPostingOrderByUserId(long userId, int Status) { var response = new ResponseCollectionModel <OrderList>(); var dt = this.instance.GetPostingOrderByUserId(userId, Status); var lstbidding = DataAccessUtility.ConvertToList <OrderList>(dt); response.Response = lstbidding; response.Status = Constants.WebApiStatusOk; return(response); }
/// <summary> /// Get list of bidding done by userid (false means Current posting otherwise close posting). /// </summary> /// <param name="userId"></param> /// <param name="isPast"></param> /// <returns></returns> public ResponseCollectionModel <PostingListBid> GetBidStatusByUserId(long userId, Int16 status) { var response = new ResponseCollectionModel <PostingListBid>(); var dt = this.instanceBidding.GetBidStatusByUserId(userId, status); var lst = DataAccessUtility.ConvertToList <PostingListBid>(dt); response.Response = lst; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseCollectionModel <ProductInstallDetails> GetInstallProductListByUserId(long userId, long installer) { var response = new ResponseCollectionModel <ProductInstallDetails>(); var dt = this.instance.GetInstallProductListByUserId(userId, installer); response.Response = DataAccessUtility.ConvertToList <ProductInstallDetails>(dt); response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <ProductInstallDetails> GetInstallProductById(long DtlProductId, long productId, long vehicleId) { var response = new ResponseSingleModel <ProductInstallDetails>(); var dt = this.instance.GetInstallProductById(DtlProductId, productId, vehicleId); response.Response = DataAccessUtility.ConvertToList <ProductInstallDetails>(dt)[0]; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseCollectionModel <Vehicle> GetVehicleListByUserId(long userId) { var response = new ResponseCollectionModel <Vehicle>(); var dt = this.instance.GetVehicleListByUserId(userId); response.Response = DataAccessUtility.ConvertToList <Vehicle>(dt); response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <Product> GetById(long productId) { var response = new ResponseSingleModel <Product>(); var dt = this.instance.GetById(productId); response.Response = DataAccessUtility.ConvertToList <Product>(dt)[0]; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <InsuranceDetails> GetInsuranceById(long vehicleId, long insuranceId) { var response = new ResponseSingleModel <InsuranceDetails>(); var dt = this.instance.GetInsuranceById(vehicleId, insuranceId); InsuranceDetails insuranceDetails = DataAccessUtility.ConvertToList <InsuranceDetails>(dt)[0]; response.Response = insuranceDetails; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseCollectionModel <TransportType> GetTransportTypeByUserId(long userid, out string message) { var result = new ResponseCollectionModel <TransportType>(); message = string.Empty; var data = instance.GetTransportTypeByUserId(userid, out message); result.Response = DataAccessUtility.ConvertToList <TransportType>(data); result.Status = Constants.WebApiStatusOk; return(result); }
public ResponseSingleModel <Vehicle> GetVehicleById(long vehicleId) { var response = new ResponseSingleModel <Vehicle>(); var dt = this.instance.GetById(vehicleId); Vehicle vehicle = DataAccessUtility.ConvertToList <Vehicle>(dt)[0]; response.Response = vehicle; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <PostingSummary> GetPostingSummary(long userId) { var result = new ResponseSingleModel <PostingSummary>(); var dt = this.instance.GetPostingSummary(UserId); var lst = DataAccessUtility.ConvertToList <PostingSummary>(dt); PostingSummary summary = lst.Count > 0 ? lst[0] : null; result.Response = summary; result.Status = summary != null ? Constants.WebApiStatusOk : Constants.WebApiStatusFail; result.Message = ""; return(result); }
public ResponseSingleModel <BiddingProfile> GetBiddingDetailById(long biddingId) { var response = new ResponseSingleModel <BiddingProfile>(); var ds = this.instanceBidding.GetById(biddingId); BiddingProfile biddingProfile = DataAccessUtility.ConvertToList <BiddingProfile>(ds.Tables[0])[0]; biddingProfile.biddingDetails = DataAccessUtility.ConvertToList <BiddingDetails>(ds.Tables[1]); response.Response = biddingProfile; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseCollectionModel <PostingList> GetPostingListByUserId(long userId, bool isPast, out string message) { var result = new ResponseCollectionModel <PostingList>(); message = string.Empty; var dt = this.instance.GetListPostingByUserId(userId, isPast, out message); result.Response = DataAccessUtility.ConvertToList <PostingList>(dt); result.Status = Constants.WebApiStatusOk; result.Message = message; return(result); }
public ResponseSingleModel <Company> GetCompanyDetailByUserId(long userId, out string message) { var result = new ResponseSingleModel <Company>(); message = string.Empty; var dt = this.instance.GetByUserId(userId, out message); var lst = DataAccessUtility.ConvertToList <Company>(dt); result.Response = lst != null && lst.Count > 0 ? lst[0] : null; result.Status = lst != null && lst.Count > 0 ? Constants.WebApiStatusOk : Constants.WebApiStatusFail; result.Message = message; return(result); }
public ResponseSingleModel <PostingProfileView> GetPostingProfileById(long postingId, out string message) { var result = new ResponseSingleModel <PostingProfileView>(); message = string.Empty; var dt = this.instance.GetById(postingId, out message); var lstProfile = DataAccessUtility.ConvertToList <QTrans.Models.ViewModel.Posting.PostingProfileView>(dt); result.Response = lstProfile != null && lstProfile.Count > 0 ? lstProfile[0] : null;; result.Status = Constants.WebApiStatusOk; result.Message = message; return(result); }
/// <summary> /// Get Min Max Amount of bidding by DtlPostId. /// </summary> /// <param name="dtlpostId"></param> /// <returns>return bid min max amount and total bid</returns> public ResponseSingleModel <BidMinMaxAmount> GetBidMinMaxByDtlPostId(long dtlpostId) { var response = new ResponseSingleModel <BidMinMaxAmount>(); var dt = this.instanceBidding.GetMinMaxBidAmount(dtlpostId); var result = DataAccessUtility.ConvertToList <BidMinMaxAmount>(dt); response.Response = result != null && result.Count > 0 ? result[0] : new BidMinMaxAmount() { dtlpostingid = dtlpostId }; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <UserProfile> Login(string username, string password, out string message) { var result = new ResponseSingleModel <UserProfile>(); message = string.Empty; var dt = instance.UserLogIn(username, password, out message); var lst = DataAccessUtility.ConvertToList <UserProfile>(dt); UserProfile user = lst != null && lst.Count > 0 ? lst[0] : null; result.Response = user; result.Status = user != null ? Constants.WebApiStatusOk : Constants.WebApiStatusFail; result.Message = message; return(result); }
public ResponseSingleModel <UserProfile> GetUserDetailByToken(string token, out string message) { var result = new ResponseSingleModel <UserProfile>(); message = string.Empty; var dt = instance.GetBytoken(token, out message); var lst = DataAccessUtility.ConvertToList <UserProfile>(dt); UserProfile user = lst != null && lst.Count > 0 ? lst[0] : null; result.Response = user; result.Status = user != null ? Constants.WebApiStatusOk : Constants.WebApiStatusFail; result.Message = message; return(result); }
public ResponseCollectionModel <CityPincode> GetPincode() { var result = new ResponseCollectionModel <CityPincode>(); if (InMemoryStorage.Instance.PincodeStorage.Count > 0) { result.Response = InMemoryStorage.Instance.PincodeStorage.Values.ToList(); } else { var data = instance.GetPincode(); result.Response = DataAccessUtility.ConvertToList <CityPincode>(data); } result.Status = Constants.WebApiStatusOk; return(result); }
/// <summary> /// Get list of bidding done by userid. /// </summary> /// <param name="userId"></param> /// <param name="message"></param> /// <returns></returns> public ResponseCollectionModel <BiddingListDetails> GetBiddingListByDtPostingId(long DtlPostingId) { var message = ""; var response = new ResponseCollectionModel <BiddingListDetails>(); var ds = this.instanceBidding.GetBiddingListByDtlPostId(DtlPostingId); var lstbidding = DataAccessUtility.ConvertToList <BiddingListDetails>(ds.Tables[0]); var lstBidDetails = DataAccessUtility.ConvertToList <BiddingDetails>(ds.Tables[1]); foreach (var bid in lstbidding) { bid.biddingDetails = lstBidDetails.Where(item => item.biddingid == bid.biddingid).ToList(); } response.Response = lstbidding; response.Status = Constants.WebApiStatusOk; return(response); }
public ResponseSingleModel <bool> ForgotUserLoginDetail(string mobileNo, string emailAddress, out string message) { var result = new ResponseSingleModel <bool>(); message = string.Empty; var dt = instance.ForgotUserLoginDetail(mobileNo, emailAddress, out message); var lst = DataAccessUtility.ConvertToList <UserProfile>(dt); UserProfile user = lst != null && lst.Count > 0 ? lst[0] : null; result.Response = user != null; result.Status = result.Response ? Constants.WebApiStatusOk : Constants.WebApiStatusFail; result.Message = message; if (user != null) { SmtpMailUtility.SendMail(user.emailaddress, "*****@*****.**", "New Password for your QTrans account", "Hello, This is auto generated mail. Your password is :" + user.Password, false); } return(result); }
public ResponseCollectionModel <CountryState> GetState() { var response = new ResponseCollectionModel <CountryState>(); if (InMemoryStorage.Instance.StateStorage.Count > 0) { var lst = InMemoryStorage.Instance.StateStorage.Values.ToList(); response.Response = lst; } else { var data = instance.GetState(); var lst = DataAccessUtility.ConvertToList <CountryState>(data); response.Response = lst; } response.Status = Constants.WebApiStatusOk; return(response); }