Example #1
0
        /// <summary>
        /// 根据编号查询出所对应的信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public CompanyShow SelAllShow(int id)
        {
            CompanyShow model = new CompanyShow();
            string      sql   = "select  CompanyID,UserName,UserPwd,TelPhone,Mobile,Email,Audit,StartTime,Valid,TypeName,Hit,countrycode,provinceid,cityid,countyid,orderId,Recomm,RoleId ,CompanyName,Industry"
                                + " from CompanyShow  where CompanyID=@id ";

            SqlParameter[] para =
            {
                new SqlParameter("@id", SqlDbType.Int, 8)
            };
            para[0].Value = id;
            DataSet ds = crm.QueryShow(sql, para);

            if (ds != null & ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["CompanyID"].ToString() != "")
                {
                    model.CompanyID = int.Parse(ds.Tables[0].Rows[0]["CompanyID"].ToString()); //编号
                }
                model.UserName = ds.Tables[0].Rows[0]["UserName"].ToString();                  //用户名
                if (ds.Tables[0].Rows[0]["UserPwd"].ToString() != "")
                {
                    model.UserPwd = (byte[])ds.Tables[0].Rows[0]["UserPwd"];  //密码
                }
                model.TelPhone = ds.Tables[0].Rows[0]["TelPhone"].ToString(); //电话号码
                model.Mobile   = ds.Tables[0].Rows[0]["Mobile"].ToString();   //手机号码
                model.Email    = ds.Tables[0].Rows[0]["Email"].ToString();    //电子邮箱
                if (ds.Tables[0].Rows[0]["Audit"].ToString() != "")
                {
                    model.Audit = int.Parse(ds.Tables[0].Rows[0]["Audit"].ToString());//审核状态
                }
                if (ds.Tables[0].Rows[0]["StartTime"].ToString() != "")
                {
                    model.StartTime = DateTime.Parse(ds.Tables[0].Rows[0]["StartTime"].ToString());//发布时间
                }
                if (ds.Tables[0].Rows[0]["Valid"].ToString() != "")
                {
                    model.Valid = int.Parse(ds.Tables[0].Rows[0]["Valid"].ToString()); //展厅有效期
                }
                model.TypeName = ds.Tables[0].Rows[0]["TypeName"].ToString();          //所属类型

                model.Countrycode = ds.Tables[0].Rows[0]["countrycode"].ToString();
                model.Provinceid  = ds.Tables[0].Rows[0]["provinceid"].ToString();
                model.Cityid      = ds.Tables[0].Rows[0]["cityid"].ToString();
                model.Countyid    = ds.Tables[0].Rows[0]["countyid"].ToString();
                model.OrderId     = int.Parse(ds.Tables[0].Rows[0]["orderId"].ToString());
                model.RoleId      = int.Parse(ds.Tables[0].Rows[0]["RoleId"].ToString());
                model.Recomm      = ds.Tables[0].Rows[0]["Recomm"].ToString();
                model.CompanyName = ds.Tables[0].Rows[0]["CompanyName"].ToString();
                if (ds.Tables[0].Rows[0]["Hit"].ToString() != "")
                {
                    model.Hit = int.Parse(ds.Tables[0].Rows[0]["Hit"].ToString());//点击率
                }

                model.Industry = ds.Tables[0].Rows[0]["Industry"].ToString();    //点击率


                return(model);
            }
            else
            {
                return(null);
            }
        }