Exemplo n.º 1
0
        public void SaveCarPicturesFromDealerSite(int CarID, string PicLocation, string PicName, int UserID)
        {
            UCEDealerSiteBL objDealer     = new UCEDealerSiteBL();
            UsedCarsInfo    objCarPicInfo = new UsedCarsInfo();

            Dealer.DealerActions objAction = new CarsBL.Dealer.DealerActions();
            string bSuccess = string.Empty;

            try
            {
                DataSet ds = objDealer.GetCarImageIDsToDealerSite(CarID);
                objCarPicInfo.Carid = Convert.ToInt32(CarID);
                string picId = objDealer.SaveCarPictureFromDealerSite(PicLocation, PicName, UserID);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objCarPicInfo.PIC0  = ds.Tables[0].Rows[0]["pic0"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic0"].ToString();
                        objCarPicInfo.PIC1  = ds.Tables[0].Rows[0]["pic1"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic1"].ToString();
                        objCarPicInfo.PIC2  = ds.Tables[0].Rows[0]["pic2"].ToString() == "" ? null: ds.Tables[0].Rows[0]["pic2"].ToString();
                        objCarPicInfo.PIC3  = ds.Tables[0].Rows[0]["pic3"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic3"].ToString();
                        objCarPicInfo.PIC4  = ds.Tables[0].Rows[0]["pic4"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic4"].ToString();
                        objCarPicInfo.PIC5  = ds.Tables[0].Rows[0]["pic5"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic5"].ToString();
                        objCarPicInfo.PIC6  = ds.Tables[0].Rows[0]["pic6"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic6"].ToString();
                        objCarPicInfo.PIC7  = ds.Tables[0].Rows[0]["pic7"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic7"].ToString();
                        objCarPicInfo.PIC8  = ds.Tables[0].Rows[0]["pic8"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic8"].ToString();
                        objCarPicInfo.PIC9  = ds.Tables[0].Rows[0]["pic9"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic9"].ToString();
                        objCarPicInfo.PIC10 = ds.Tables[0].Rows[0]["pic10"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic10"].ToString();
                        objCarPicInfo.PIC11 = ds.Tables[0].Rows[0]["pic11"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic11"].ToString();
                        objCarPicInfo.PIC12 = ds.Tables[0].Rows[0]["pic12"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic12"].ToString();
                        objCarPicInfo.PIC13 = ds.Tables[0].Rows[0]["pic13"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic13"].ToString();
                        objCarPicInfo.PIC14 = ds.Tables[0].Rows[0]["pic14"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic14"].ToString();
                        objCarPicInfo.PIC15 = ds.Tables[0].Rows[0]["pic15"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic15"].ToString();
                        objCarPicInfo.PIC16 = ds.Tables[0].Rows[0]["pic16"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic16"].ToString();
                        objCarPicInfo.PIC17 = ds.Tables[0].Rows[0]["pic17"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic17"].ToString();
                        objCarPicInfo.PIC18 = ds.Tables[0].Rows[0]["pic18"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic18"].ToString();
                        objCarPicInfo.PIC19 = ds.Tables[0].Rows[0]["pic19"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic19"].ToString();
                        objCarPicInfo.PIC20 = ds.Tables[0].Rows[0]["pic20"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic20"].ToString();

                        if (objCarPicInfo.PIC0 == null || objCarPicInfo.PIC0 == "")
                        {
                            objCarPicInfo.PIC0 = picId;
                        }
                        else if (objCarPicInfo.PIC1 == null || objCarPicInfo.PIC1 == "")
                        {
                            objCarPicInfo.PIC1 = picId;
                        }
                        else if (objCarPicInfo.PIC2 == null || objCarPicInfo.PIC2 == "")
                        {
                            objCarPicInfo.PIC2 = picId;
                        }
                        else if (objCarPicInfo.PIC3 == null || objCarPicInfo.PIC3 == "")
                        {
                            objCarPicInfo.PIC3 = picId;
                        }
                        else if (objCarPicInfo.PIC4 == null || objCarPicInfo.PIC4 == "")
                        {
                            objCarPicInfo.PIC4 = picId;
                        }
                        else if (objCarPicInfo.PIC5 == null || objCarPicInfo.PIC5 == "")
                        {
                            objCarPicInfo.PIC5 = picId;
                        }
                        else if (objCarPicInfo.PIC6 == null || objCarPicInfo.PIC6 == "")
                        {
                            objCarPicInfo.PIC6 = picId;
                        }
                        else if (objCarPicInfo.PIC7 == null || objCarPicInfo.PIC7 == "")
                        {
                            objCarPicInfo.PIC7 = picId;
                        }
                        else if (objCarPicInfo.PIC8 == null || objCarPicInfo.PIC8 == "")
                        {
                            objCarPicInfo.PIC8 = picId;
                        }
                        else if (objCarPicInfo.PIC9 == null || objCarPicInfo.PIC9 == "")
                        {
                            objCarPicInfo.PIC9 = picId;
                        }
                        else if (objCarPicInfo.PIC10 == null || objCarPicInfo.PIC10 == "")
                        {
                            objCarPicInfo.PIC10 = picId;
                        }
                        else if (objCarPicInfo.PIC11 == null || objCarPicInfo.PIC11 == "")
                        {
                            objCarPicInfo.PIC11 = picId;
                        }
                        else if (objCarPicInfo.PIC12 == null || objCarPicInfo.PIC12 == "")
                        {
                            objCarPicInfo.PIC12 = picId;
                        }
                        else if (objCarPicInfo.PIC13 == null || objCarPicInfo.PIC13 == "")
                        {
                            objCarPicInfo.PIC13 = picId;
                        }
                        else if (objCarPicInfo.PIC14 == null || objCarPicInfo.PIC14 == "")
                        {
                            objCarPicInfo.PIC14 = picId;
                        }
                        else if (objCarPicInfo.PIC15 == null || objCarPicInfo.PIC15 == "")
                        {
                            objCarPicInfo.PIC15 = picId;
                        }
                        else if (objCarPicInfo.PIC16 == null || objCarPicInfo.PIC16 == "")
                        {
                            objCarPicInfo.PIC16 = picId;
                        }
                        else if (objCarPicInfo.PIC17 == null || objCarPicInfo.PIC17 == "")
                        {
                            objCarPicInfo.PIC17 = picId;
                        }
                        else if (objCarPicInfo.PIC18 == null || objCarPicInfo.PIC18 == "")
                        {
                            objCarPicInfo.PIC18 = picId;
                        }
                        else if (objCarPicInfo.PIC19 == null || objCarPicInfo.PIC19 == "")
                        {
                            objCarPicInfo.PIC19 = picId;
                        }
                        else if (objCarPicInfo.PIC20 == null || objCarPicInfo.PIC19 == "")
                        {
                            objCarPicInfo.PIC20 = picId;
                        }

                        objDealer.UpdatePicturesByIdFromDealerSite(objCarPicInfo, UserID);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        public void SaveCarPicturesFromDealerSite(int CarID, string PicLocation, string PicName, int UserID)
        {
            UCEDealerSiteBL objDealer = new UCEDealerSiteBL();
            UsedCarsInfo objCarPicInfo = new UsedCarsInfo();
            Dealer.DealerActions objAction = new CarsBL.Dealer.DealerActions();
            string bSuccess = string.Empty;
            try
            {
                DataSet ds = objDealer.GetCarImageIDsToDealerSite(CarID);
                objCarPicInfo.Carid = Convert.ToInt32(CarID);
                string picId = objDealer.SaveCarPictureFromDealerSite(PicLocation, PicName, UserID);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objCarPicInfo.PIC0 = ds.Tables[0].Rows[0]["pic0"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic0"].ToString();
                        objCarPicInfo.PIC1 = ds.Tables[0].Rows[0]["pic1"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic1"].ToString();
                        objCarPicInfo.PIC2 = ds.Tables[0].Rows[0]["pic2"].ToString() == "" ? null: ds.Tables[0].Rows[0]["pic2"].ToString();
                        objCarPicInfo.PIC3 = ds.Tables[0].Rows[0]["pic3"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic3"].ToString();
                        objCarPicInfo.PIC4 = ds.Tables[0].Rows[0]["pic4"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic4"].ToString();
                        objCarPicInfo.PIC5 = ds.Tables[0].Rows[0]["pic5"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic5"].ToString();
                        objCarPicInfo.PIC6 = ds.Tables[0].Rows[0]["pic6"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic6"].ToString();
                        objCarPicInfo.PIC7 = ds.Tables[0].Rows[0]["pic7"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic7"].ToString();
                        objCarPicInfo.PIC8 = ds.Tables[0].Rows[0]["pic8"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic8"].ToString();
                        objCarPicInfo.PIC9 = ds.Tables[0].Rows[0]["pic9"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic9"].ToString();
                        objCarPicInfo.PIC10 = ds.Tables[0].Rows[0]["pic10"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic10"].ToString();
                        objCarPicInfo.PIC11 = ds.Tables[0].Rows[0]["pic11"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic11"].ToString();
                        objCarPicInfo.PIC12 = ds.Tables[0].Rows[0]["pic12"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic12"].ToString();
                        objCarPicInfo.PIC13 = ds.Tables[0].Rows[0]["pic13"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic13"].ToString();
                        objCarPicInfo.PIC14 = ds.Tables[0].Rows[0]["pic14"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic14"].ToString();
                        objCarPicInfo.PIC15 = ds.Tables[0].Rows[0]["pic15"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic15"].ToString();
                        objCarPicInfo.PIC16 = ds.Tables[0].Rows[0]["pic16"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic16"].ToString();
                        objCarPicInfo.PIC17 = ds.Tables[0].Rows[0]["pic17"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic17"].ToString();
                        objCarPicInfo.PIC18 = ds.Tables[0].Rows[0]["pic18"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic18"].ToString();
                        objCarPicInfo.PIC19 = ds.Tables[0].Rows[0]["pic19"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic19"].ToString();
                        objCarPicInfo.PIC20 = ds.Tables[0].Rows[0]["pic20"].ToString() == "" ? null : ds.Tables[0].Rows[0]["pic20"].ToString();

                        if (objCarPicInfo.PIC0 == null || objCarPicInfo.PIC0 == "")
                        {
                            objCarPicInfo.PIC0 = picId;
                        }
                        else if (objCarPicInfo.PIC1 == null || objCarPicInfo.PIC1 == "")
                        {
                            objCarPicInfo.PIC1 = picId;
                        }
                        else if (objCarPicInfo.PIC2 == null || objCarPicInfo.PIC2 == "")
                        {
                            objCarPicInfo.PIC2 = picId;
                        }
                        else if (objCarPicInfo.PIC3 == null || objCarPicInfo.PIC3 == "")
                        {
                            objCarPicInfo.PIC3 = picId;

                        }
                        else if (objCarPicInfo.PIC4 == null || objCarPicInfo.PIC4 == "")
                        {
                            objCarPicInfo.PIC4 = picId;
                        }
                        else if (objCarPicInfo.PIC5 == null || objCarPicInfo.PIC5 == "")
                        {
                            objCarPicInfo.PIC5 = picId;
                        }
                        else if (objCarPicInfo.PIC6 == null || objCarPicInfo.PIC6 == "")
                        {
                            objCarPicInfo.PIC6 = picId;
                        }
                        else if (objCarPicInfo.PIC7 == null || objCarPicInfo.PIC7 == "")
                        {
                            objCarPicInfo.PIC7 = picId;
                        }
                        else if (objCarPicInfo.PIC8 == null || objCarPicInfo.PIC8 == "")
                        {
                            objCarPicInfo.PIC8 = picId;
                        }
                        else if (objCarPicInfo.PIC9 == null || objCarPicInfo.PIC9 == "")
                        {
                            objCarPicInfo.PIC9 = picId;
                        }
                        else if (objCarPicInfo.PIC10 == null || objCarPicInfo.PIC10 == "")
                        {
                            objCarPicInfo.PIC10 = picId;
                        }
                        else if (objCarPicInfo.PIC11 == null || objCarPicInfo.PIC11 == "")
                        {
                            objCarPicInfo.PIC11 = picId;
                        }
                        else if (objCarPicInfo.PIC12 == null || objCarPicInfo.PIC12 == "")
                        {
                            objCarPicInfo.PIC12 = picId;
                        }
                        else if (objCarPicInfo.PIC13 == null || objCarPicInfo.PIC13 == "")
                        {
                            objCarPicInfo.PIC13 = picId;
                        }
                        else if (objCarPicInfo.PIC14 == null || objCarPicInfo.PIC14 == "")
                        {
                            objCarPicInfo.PIC14 = picId;
                        }
                        else if (objCarPicInfo.PIC15 == null || objCarPicInfo.PIC15 == "")
                        {
                            objCarPicInfo.PIC15 = picId;
                        }
                        else if (objCarPicInfo.PIC16 == null || objCarPicInfo.PIC16 == "")
                        {
                            objCarPicInfo.PIC16 = picId;
                        }
                        else if (objCarPicInfo.PIC17 == null || objCarPicInfo.PIC17 == "")
                        {
                            objCarPicInfo.PIC17 = picId;
                        }
                        else if (objCarPicInfo.PIC18 == null || objCarPicInfo.PIC18 == "")
                        {
                            objCarPicInfo.PIC18 = picId;
                        }
                        else if (objCarPicInfo.PIC19 == null || objCarPicInfo.PIC19 == "")
                        {
                            objCarPicInfo.PIC19 = picId;
                        }
                        else if (objCarPicInfo.PIC20 == null || objCarPicInfo.PIC19 == "")
                        {
                            objCarPicInfo.PIC20 = picId;
                        }

                        objDealer.UpdatePicturesByIdFromDealerSite(objCarPicInfo, UserID);

                    }
                }
            }
            catch (Exception ex)
            {
            }
        }