Ejemplo n.º 1
0
 public List<CarsInfo.UCEDealerInfo> UploadCarDetailsFromDealerSite(CarsInfo.DealerSiteCarInfo objDealerCaInfo,string Action)
 {
     var obj = new List<CarsInfo.UCEDealerInfo>();
     try
     {
         CarsBL.DealerSiteBL.UploadCarDealerSiteBL objDealerCar = new CarsBL.DealerSiteBL.UploadCarDealerSiteBL();
         if (Action == "Upload")
         {
             obj = (List<CarsInfo.UCEDealerInfo>)objDealerCar.UploadCar(objDealerCaInfo);
         }
         else
         {
             obj = (List<CarsInfo.UCEDealerInfo>)objDealerCar.UpdateCar(objDealerCaInfo);
         }
     }
     catch (Exception ex)
     {
     }
     return obj;
 }
Ejemplo n.º 2
0
    public void UploadCarPictures(string PicFullPath, string CarID, string Make, string Model, string Year, string CarNum, string UID)
    {
        try
        {
            CarsBL.DealerSiteBL.UploadCarDealerSiteBL objCar = new CarsBL.DealerSiteBL.UploadCarDealerSiteBL();
            int Carnum = Convert.ToInt32(CarNum);
            string picNeLocation = "CarService/CarImages/" + Year + "/" + Make + "/" + Model + "/" + CarID;
            string PicFileNewName = Year + "_" + Make + "_" + Model + "_" + CarID + Carnum + ".jpg";
            string localPath = Server.MapPath("~/" + picNeLocation + "/");

            if (System.IO.Directory.Exists(localPath) == false)
            {
                System.IO.Directory.CreateDirectory(localPath);
            }

            string NewPicFileFullPath = localPath + PicFileNewName;
            //string localpath = "E:\\Jagadesh\\j.jpg";
            using (WebClient Client = new WebClient())
            {
                Client.DownloadFile(PicFullPath, NewPicFileFullPath);
                // Client.DownloadFile(
            }

            objCar.SaveCarPicturesFromDealerSite(Convert.ToInt32(CarID), picNeLocation, PicFileNewName, Convert.ToInt32(UID));
        }
        catch (Exception ex)
        {
            while (ex != null)
            {
                Console.WriteLine(ex.Message);
                ex = ex.InnerException;
            }
        }
    }
Ejemplo n.º 3
0
 public string UploadCarFeaturesFromDealerSite(string CarID, string FeatureNmae, string FeatureTypeName, string Isactive, string UID)
 {
     string sCarID = string.Empty;
     DataSet dsCarID = new DataSet();
     try
     {
         CarsBL.DealerSiteBL.UploadCarDealerSiteBL objDealerCar = new CarsBL.DealerSiteBL.UploadCarDealerSiteBL();
         dsCarID = objDealerCar.UploadCarFeatures(CarID, FeatureNmae, FeatureTypeName, Isactive, UID);
         if (dsCarID.Tables.Count > 0)
         {
             if (dsCarID.Tables[0].Rows.Count > 0)
             {
                 sCarID = dsCarID.Tables[0].Rows[0]["CarID"].ToString();
             }
         }
     }
     catch (Exception ex)
     {
     }
     return sCarID;
 }