Example #1
0
        /// <summary>
        /// 添加专题库
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        public static bool AddZTDB(string Name, string Desc, string type)
        {
            STZTList ztst = new STZTList()
            {
                Name = Name, Des = Desc, DbType = type, CreateUserID = 1, IsDel = 0, CreateTime = DateTime.Now
            };

            MySqlHelper.DataContext.STZTList.InsertOnSubmit(ztst);
            MySqlHelper.DataContext.SubmitChanges();
            return(true);
        }
Example #2
0
        /// <summary>
        /// 修改专题库
        /// </summary>
        /// <param name="id"></param>
        /// <param name="Name"></param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        public static bool EditZTDB(string id, string Name, string Desc, string type)
        {
            var x = from y in MySqlHelper.DataContext.STZTList
                    where y.ID.ToString() == id
                    select y;

            if (x.Count() == 0)
            {
                return(false);
            }
            else
            {
                STZTList zt = x.First();
                zt.Name   = Name;
                zt.Des    = Desc;
                zt.DbType = type;
                MySqlHelper.DataContext.SubmitChanges();
                return(true);
            }
        }