Beispiel #1
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="newData">数据</param>
        public int AddData(Scm_ProductDto newData)
        {
            newData.ProductId  = Guid.NewGuid().ToSequentialGuid();
            newData.CreateTime = DateTime.Now;
            newData.ProductNo  = NoExtension.ShortNo(Guid.NewGuid().GetHashCode().ToString());
            var result = Insert(newData);

            if (result == 0)
            {
                throw new Exception("添加失败!");
            }

            return(result);
        }
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="newData">数据</param>
        public int AddData(Crm_CustomerDto newData)
        {
            newData.CustomerId = Guid.NewGuid().ToSequentialGuid();
            newData.CreateTime = DateTime.Now;
            newData.Password   = newData.Password.Trim().ToMD5String();
            newData.No         = NoExtension.ShortNo(Guid.NewGuid().GetHashCode().ToString());

            var result = Insert(newData);

            if (result == 0)
            {
                throw new Exception("添加失败!");
            }

            return(result);
        }