Beispiel #1
0
        public IList<MultisiteInfo> GetMultiSitePostingsByCariD(int carID)
        {
            //Decalaring MakesInfo division object collection
            IList<MultisiteInfo> MakesInfoIList = new List<MultisiteInfo>();

            string spNameString = string.Empty;

            //Setting Connection
            //Global.INSTANCE_NAME = strCurrentConn;

            IDataReader MakesInfoDataReader = null;

            //Connect to the database
            Database dbDatabase = DatabaseFactory.CreateDatabase(Global.INSTANCE_NAME);

            //Assign stored procedure name

            spNameString = "USP_GetMultiSitePostingURLsByCarID";
            DbCommand dbCommand = null;

            try
            {
                //Set stored procedure to the command object
                dbCommand = dbDatabase.GetStoredProcCommand(spNameString);

                dbDatabase.AddInParameter(dbCommand, "@carid", DbType.Int64, carID);

                //Executing stored procedure
                MakesInfoDataReader = dbDatabase.ExecuteReader(dbCommand);

                while (MakesInfoDataReader.Read())
                {
                    //Assign values to the MakesInfo object list
                    MultisiteInfo ObjMakesInfo_Info = new MultisiteInfo();
                    AssignMultiSiteInfoList(MakesInfoDataReader, ObjMakesInfo_Info);
                    MakesInfoIList.Add(ObjMakesInfo_Info);
                }
            }
            catch (Exception ex)
            {

            }
            finally
            {
                MakesInfoDataReader.Close();
            }

            return MakesInfoIList;
        }
    public List<CarsInfo.MultisiteInfo> GetMultisiteListingsByCarID(string CarID, string AuthenticationID, string CustomerID, string SessionID,string UID)
    {
        List<CarsInfo.MultisiteInfo> obj = new List<CarsInfo.MultisiteInfo>();
        MobileBL objMobileBL = new MobileBL();
        MultisiteInfo objCarInfo = new MultisiteInfo();
        if (CustomerID.Trim() != "")
        {
            DataSet dsSaveCustInfo = objMobileBL.SaveMobileCustomerInfo("GetMultisiteListingsByCarID", CustomerID, AuthenticationID,CarID);
        }
        try
        {

            bool bnew = objMobileBL.CheckMobileAuthorizeUSer(SessionID, Convert.ToInt32(UID));
            if (bnew)
            {
                int carIDnew = CarID == "" ? 0 : Convert.ToInt32(CarID);

                obj = (List<CarsInfo.MultisiteInfo>)objMobileBL.GetMultiSitePostingsByCariD(carIDnew);

                if (obj.Count <=0)
                {

                    objCarInfo.AASuccess = "Failure";
                    obj.Add(objCarInfo);
                }

            }
            else
            {
                objCarInfo.AASuccess = "Session timed out";
                obj.Add(objCarInfo);
            }

        }
        catch (Exception ex)
        {
        }
        return obj;
    }
Beispiel #3
0
        private void AssignMultiSiteInfoList(IDataReader MakesInfoDataReader, MultisiteInfo ObjMakesInfo_Info)
        {
            try
               {
               ObjMakesInfo_Info.AASuccess = "Success";
               ObjMakesInfo_Info.MultiSiteName = MakesInfoDataReader["SiteName"].ToString();
               ObjMakesInfo_Info.MultisitesURL = MakesInfoDataReader["URL"].ToString();
               ObjMakesInfo_Info.PostedDate = MakesInfoDataReader["UrlPostDate"].ToString();
               ObjMakesInfo_Info.ValidDays = MakesInfoDataReader["ValidDays"].ToString();

               }
               catch (Exception ex)
               {
               }
        }