Exemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(KeyWords model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into KeyWords(");
            strSql.Append("WebTitle,WebKeyWord,description,RoseID,UserName)");
            strSql.Append(" values (");
            strSql.Append("@WebTitle,@WebKeyWord,@description,@RoseID,@UserName)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@WebTitle",    SqlDbType.NVarChar),
                new SqlParameter("@WebKeyWord",  SqlDbType.NVarChar),
                new SqlParameter("@description", SqlDbType.NVarChar),
                new SqlParameter("@RoseID",      SqlDbType.Int,4),
                new SqlParameter("@UserName",    SqlDbType.VarChar, 50)
            };
            parameters[0].Value = model.WebTitle;
            parameters[1].Value = model.WebKeyWord;
            parameters[2].Value = model.description;
            parameters[3].Value = model.RoseID;
            parameters[4].Value = model.UserName;

            object obj = crm.GetSingles(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Tz888.Model.dp.SysPermissionTab model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into SysPermissionTab(");
            strSql.Append("RoleID,SPCode,SPDate)");
            strSql.Append(" values (");
            strSql.Append("@RoleID,@SPCode,@SPDate)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@RoleID", SqlDbType.Int,        4),
                new SqlParameter("@SPCode", SqlDbType.VarChar, 2000),
                new SqlParameter("@SPDate", SqlDbType.DateTime)
            };
            parameters[0].Value = model.RoleID;
            parameters[1].Value = model.SPCode;
            parameters[2].Value = model.SPDate;

            object obj = crm.GetSingles(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Tz888.Model.dp.SysRoleTab model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into SysRoleTab(");
            strSql.Append("SRName,SRDoc,SysCode,SRDate)");
            strSql.Append(" values (");
            strSql.Append("@SRName,@SRDoc,@SysCode,@SRDate)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SRName",  SqlDbType.VarChar, 100),
                new SqlParameter("@SRDoc",   SqlDbType.VarChar, 200),
                new SqlParameter("@SysCode", SqlDbType.VarChar, 100),
                new SqlParameter("@SRDate",  SqlDbType.DateTime)
            };
            parameters[0].Value = model.SRName;
            parameters[1].Value = model.SRDoc;
            parameters[2].Value = model.SysCode;
            parameters[3].Value = model.SRDate;

            object obj = crm.GetSingles(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Tz888.Model.dp.System model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into System(EmployeeID,");
            strSql.Append("Tem)");
            strSql.Append(" values (");
            strSql.Append("@EmployeeID,@Tem)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmployeeID", SqlDbType.VarChar, 50),
                new SqlParameter("@Tem",        SqlDbType.VarChar, 100)
            };
            parameters[0].Value = model.EmployeeID;
            parameters[1].Value = model.Tem;

            object obj = crm.GetSingles(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }