Esempio n. 1
0
        /// <summary>
        /// 获取单个商品信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public SpxxModel GetSpxxDetailById(string spId)
        {
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("select  spId,spName,spHPH,spCPRQ,spCPRQC,spHPDQR,spPJJE,spCDRQC,IsKZR,spPJZT,spSPRQC,spCPRCN,spCDRCN,IsBLJ,spPMFS,spQPJ,spJJFD,spPMKSSJ,spPMJSSJ,spMS,spFKFS,spUrl,spBZJYQ,spPJGY,AddTime,IsDel from tbl_Spxx ");
                strSql.Append(" where spId=@spId and IsDel <> '1'");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@spId", SqlDbType.Char, 32)
                };
                parameters[0].Value = spId;

                SpxxModel model = new SpxxModel();
                DataSet   ds    = DbHelperSQL.Query(strSql.ToString(), parameters);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    return(ModelEx.SetValueFromDB <SpxxModel>(model, ds.Tables[0]));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="passWord"></param>
        /// <returns></returns>
        public UserModel GetSysUser(string userName, string passWord)
        {
            string strSql = "select * from tbl_User Where  IsDel <> '1'";

            try
            {
                if (!string.IsNullOrWhiteSpace(userName))
                {
                    strSql += " and UserName = '******'";
                }
                if (!string.IsNullOrWhiteSpace(passWord))
                {
                    strSql += " and PassWord = '******'";
                }
                return(ModelEx.SetValueFromDB <UserModel>(new UserModel(), DbHelperSQL.Query(strSql).Tables[0]));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }