示例#1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tz888.Model.dp.System GetModel(string EmployeeID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 EmployeeID,Tem from System ");
            strSql.Append(" where EmployeeID=@EmployeeID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmployeeID", SqlDbType.NVarChar)
            };
            parameters[0].Value = EmployeeID;

            Tz888.Model.dp.System model = new Tz888.Model.dp.System();
            DataSet ds = crm.Querys(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["EmployeeID"].ToString() != "")
                {
                    model.EmployeeID = ds.Tables[0].Rows[0]["EmployeeID"].ToString();
                }
                model.Tem = ds.Tables[0].Rows[0]["Tem"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tz888.Model.dp.SysMenuTab GetModel(int sid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 sid,SName,SCheck,Surl,SisActive,SParentCode,SCode,Starget,SDate,SOrder,SParentSid from SysMenuTab ");
            strSql.Append(" where sid=@sid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@sid", SqlDbType.Int, 4)
            };
            parameters[0].Value = sid;

            Tz888.Model.dp.SysMenuTab model = new Tz888.Model.dp.SysMenuTab();
            DataSet ds = crm.Querys(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["sid"].ToString() != "")
                {
                    model.sid = int.Parse(ds.Tables[0].Rows[0]["sid"].ToString());
                }
                model.SName = ds.Tables[0].Rows[0]["SName"].ToString();
                if (ds.Tables[0].Rows[0]["SCheck"].ToString() != "")
                {
                    model.SCheck = int.Parse(ds.Tables[0].Rows[0]["SCheck"].ToString());
                }
                model.Surl = ds.Tables[0].Rows[0]["Surl"].ToString();
                if (ds.Tables[0].Rows[0]["SisActive"].ToString() != "")
                {
                    model.SisActive = int.Parse(ds.Tables[0].Rows[0]["SisActive"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SParentCode"].ToString() != "")
                {
                    model.SParentCode = int.Parse(ds.Tables[0].Rows[0]["SParentCode"].ToString());
                }
                model.SCode   = ds.Tables[0].Rows[0]["SCode"].ToString();
                model.Starget = ds.Tables[0].Rows[0]["Starget"].ToString();
                if (ds.Tables[0].Rows[0]["SDate"].ToString() != "")
                {
                    model.SDate = DateTime.Parse(ds.Tables[0].Rows[0]["SDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SOrder"].ToString() != "")
                {
                    model.Sorder = int.Parse(ds.Tables[0].Rows[0]["SOrder"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SParentSid"].ToString() != "")
                {
                    model.Sparentsid = int.Parse(ds.Tables[0].Rows[0]["SParentSid"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        /// <summary>
        /// 根据用户名查找是否有记录数
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public bool ExistsName(string loginName)
        {
            string  sql = "select count(UserName) as loginName from CompanyShow where UserName='******'";
            DataSet ds  = crm.Querys(sql);

            if (int.Parse(ds.Tables[0].Rows[0]["loginname"].ToString()) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tz888.Model.dp.SysPermissionTab GetModel(int SPID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 SPID,RoleID,SPCode,SPDate from SysPermissionTab ");
            strSql.Append(" where SPID=@SPID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SPID", SqlDbType.Int, 4)
            };
            parameters[0].Value = SPID;

            Tz888.Model.dp.SysPermissionTab model = new Tz888.Model.dp.SysPermissionTab();
            DataSet ds = crm.Querys(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["SPID"].ToString() != "")
                {
                    model.SPID = int.Parse(ds.Tables[0].Rows[0]["SPID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RoleID"].ToString() != "")
                {
                    model.RoleID = int.Parse(ds.Tables[0].Rows[0]["RoleID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SysID"].ToString() != "")
                {
                    model.SysID = int.Parse(ds.Tables[0].Rows[0]["SysID"].ToString());
                }
                model.SPCode = ds.Tables[0].Rows[0]["SPCode"].ToString();
                if (ds.Tables[0].Rows[0]["SPDate"].ToString() != "")
                {
                    model.SPDate = DateTime.Parse(ds.Tables[0].Rows[0]["SPDate"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public KeyWords GetModel(int RoseId, string UserName)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 Id,WebTitle,WebKeyWord,description,RoseID,UserName from KeyWords ");
            strSql.Append(" where RoseId=@RoseId and UserName=@UserName");
            SqlParameter[] parameters =
            {
                new SqlParameter("@RoseId",   SqlDbType.Int,     4),
                new SqlParameter("@UserName", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = RoseId;
            parameters[1].Value = UserName;
            KeyWords model = new KeyWords();
            DataSet  ds    = crm.Querys(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
                {
                    model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
                }
                model.WebTitle    = ds.Tables[0].Rows[0]["WebTitle"].ToString();
                model.WebKeyWord  = ds.Tables[0].Rows[0]["WebKeyWord"].ToString();
                model.description = ds.Tables[0].Rows[0]["description"].ToString();
                if (ds.Tables[0].Rows[0]["RoseID"].ToString() != "")
                {
                    model.RoseID = int.Parse(ds.Tables[0].Rows[0]["RoseID"].ToString());
                }
                model.UserName = ds.Tables[0].Rows[0]["UserName"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }