コード例 #1
0
        public OfferDetails GetOfferDetailsWorkShop(int accident_id, int workshop_id)
        {
            OfferQuery offerQuery = new OfferQuery(language);

            System.Data.DataTable dataTable    = conn_db.ReadTable(offerQuery.GetOfferDetailsWorkShop(accident_id, workshop_id));
            OfferDetails          offerDetails = new OfferDetails();

            if (dataTable.Rows.Count == 0)
            {
                throw new EmptyViewException(language);
            }


            offerDetails                    = new OfferDetails();
            offerDetails.OFFER_ID           = Convert.ToInt32(dataTable.Rows[0]["OFFER_ID"]);
            offerDetails.shop_ID            = Convert.ToInt32(dataTable.Rows[0]["WORKSHOP_ID"]);
            offerDetails.FULLNAME           = dataTable.Rows[0]["FULLNAME"].ToString();
            offerDetails.SHOPNUMBER         = dataTable.Rows[0]["SHOPNUMBER"].ToString();
            offerDetails.SHOPNAME           = dataTable.Rows[0]["SHOPNAME"].ToString();
            offerDetails.LOCATIONX_WORKSHOP = Convert.ToDouble(dataTable.Rows[0]["LOCATIONX"].ToString());
            offerDetails.LOCATIONY_WORKSHOP = Convert.ToDouble(dataTable.Rows[0]["LOCATIONY"].ToString());
            offerDetails.CONFIRMATION       = Convert.ToInt32(dataTable.Rows[0]["CONFIRMATION"].ToString());
            offerDetails.timeValue          = dataTable.Rows[0]["timeValue"] is DBNull ? 0 : Convert.ToInt32(dataTable.Rows[0]["timeValue"]);
            offerDetails.timeFlag           = dataTable.Rows[0]["timeFlag"] is DBNull ? 0 : Convert.ToInt32(dataTable.Rows[0]["timeFlag"]);
            offerDetails.PRICE              = Convert.ToDouble(dataTable.Rows[0]["PRICE"]);
            offerDetails.rating             = Convert.ToDouble(dataTable.Rows[0]["RATING"]);
            offerDetails.workshop_image     = dataTable.Rows[0]["IMAGE"].ToString();
            offerDetails.OFFER_DATETIME     = Convert.ToDateTime(dataTable.Rows[0]["OFFER_DATETIME"]).ToString("dd-MM-yyyy");
            offerDetails.canFinish          = Convert.ToInt32(dataTable.Rows[0]["WAITINGFIX"].ToString());
            offerDetails.isDelivered        = Convert.ToInt32(dataTable.Rows[0]["FINISHEDFLAG"].ToString());

            offerDetails.AreaName    = dataTable.Rows[0]["AreaName"].ToString();
            offerDetails.phonenumber = dataTable.Rows[0]["phoneNumber"].ToString();
            return(offerDetails);
        }