Exemple #1
0
 public static BidRecordInfo GetBidUser(bidder info, bid bidInfo)
 {
     if (info.bidder_is_team)
     {
         var result = GetSingleTableRecord <team>(x => x.teamId == info.tendererId);
         Assert(result != null);
         return(new BidRecordInfo
         {
             name = result.team_name,
             introduction = result.team_introduction,
             staute = BidStatus(bidInfo.purchaseId, bidInfo.bidId)
         });
     }
     else
     {
         var result = GetSingleTableRecord <vendor>(x => x.vendorId == info.tendererId);
         Assert(result != null);
         return(new BidRecordInfo
         {
             name = result.user.user_name,
             introduction = result.user.user_introduction,
             staute = BidStatus(bidInfo.purchaseId, bidInfo.bidId)
         });
     }
 }
Exemple #2
0
        public static Pair <bool, bidder> CreateBidder(int tenderId, UserType type)
        {
            Assert(type == UserType.Vendor || type == UserType.Team);
            var record = new bidder();

            record.tendererId = tenderId;
            if (type == UserType.Team)
            {
                record.bidder_is_team = true;
            }
            else if (type == UserType.Vendor)
            {
                record.bidder_is_team = false;
            }
            var result = GetSingleTableRecord <bidder>(x => x.tendererId == record.tendererId && x.bidder_is_team == record.bidder_is_team);

            if (result == null)
            {
                return(CreateRecord <bidder>(record));
            }
            return(new Pair <bool, bidder>(true, result));
        }
Exemple #3
0
 public static void FillBidRecord(bid info, bidder bidderInfo, HttpRequestBase request, String uploadName)
 {
     info.bidderId    = bidderInfo.bidderId;
     info.bid_content = UploadFileGetUrl(info, request, uploadName);
     info.bid_time    = DateTime.Now;
 }