Esempio n. 1
0
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public AjaxResult Insert(Customer entity)
        {
            AjaxResult res = new AjaxResult(ResultStatus.OK);

            entity.Valid();
            entity.CreatedOn = DateTime.Now;
            entity.CreatedBy = UserInfoBLL.GetCurrentUserGuid();
            entity.SetDefaultValue("BirthDay");
            if (entity.Insert() == 1)
            {
                res.Status = ResultStatus.OK;
            }
            else
            {
                res.Status  = ResultStatus.NO;
                res.Message = "新增失败!";
            }
            return(res);
        }
Esempio n. 2
0
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public AjaxResult Insert(PriceList entity)
        {
            AjaxResult res = new AjaxResult(ResultStatus.OK);

            entity.ListID = (entity.ListID == Guid.Empty ? Guid.NewGuid() : entity.ListID);
            entity.Valid();
            entity.CreatedOn = DateTime.Now;
            entity.CreatedBy = UserInfoBLL.GetCurrentUserGuid();
            if (entity.Insert() == 1)
            {
                res.Status = ResultStatus.OK;
            }
            else
            {
                res.Status  = ResultStatus.NO;
                res.Message = "新增失败!";
            }
            return(res);
        }