Exemple #1
0
        /// <summary>
        /// 根据省份ID获取服务商
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        public static IList <CloudServer> GetAllCloudServiceDealByProId(int proId)
        {
            IList <CloudServer> list = new List <CloudServer>();
            string sql = "select * from CloudServiceList";

            if (proId > 0)
            {
                sql += " where ProID ='" + proId + "';";
            }
            DataTable table = DBHelper.GetDataSet(sql);

            foreach (DataRow row in table.Rows)
            {
                CloudServer cldser = new CloudServer();
                cldser.CloudServiceID   = (int)row["CloudServiceID"];
                cldser.CloudServiceName = (String)row["CloudServiceName"];
                cldser.ProvinceID       = CloudServiceProService.GetCloudServiceProById(int.Parse(row["ProID"].ToString()));
                cldser.Address          = (string)row["Address"];
                cldser.Company          = (string)row["Company"];
                cldser.WebSite          = (string)row["WebSite"];
                cldser.Logo             = (string)row["Logo"];
                list.Add(cldser);
            }
            return(list);
        }
Exemple #2
0
        /// <summary>
        /// 根据服务商ID和用户ID获取服务商
        /// </summary>
        /// <param name="cloudserviceid"></param>
        /// <returns></returns>
        public static CloudServer GetCloudServiceByCldSerIdAndUserId(string cloudserviceid, string userid)
        {
            CloudServer   cldser     = new CloudServer();
            string        sql        = "select * from CloudService where CloudServiceID='" + cloudserviceid + "'";
            SqlDataReader datareader = DBHelper.GetReader(sql);

            if (datareader.Read())
            {
                cldser.CloudServiceID   = (int)datareader["CloudServiceID"];
                cldser.CloudServiceName = (string)datareader["CloudServiceName"];
                cldser.ProvinceID       = CloudServiceProService.GetCloudServiceProById(int.Parse(datareader["ProID"].ToString()));
                cldser.Address          = (string)datareader["Address"];
                cldser.Company          = (string)datareader["Company"];
                cldser.WebSite          = (string)datareader["WebSite"];
                cldser.Logo             = (string)datareader["Logo"];
            }
            datareader.Close();
            return(cldser);
        }