/// <summary>
        /// 更新数据
        /// </summary>
        public int UpdateData(Oms_OrdDetailDto theData)
        {
            var result = Modify(theData);

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

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="theData">保存的数据</param>
        public ActionResult SaveData(Oms_OrdDetailDto theData)
        {
            if (theData.OrdDetailId.IsNullOrEmpty())
            {
                _oms_OrdDetailService.AddData(theData);
            }
            else
            {
                _oms_OrdDetailService.UpdateData(theData);
            }

            return(Success());
        }
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="newData">数据</param>
        public int AddData(Oms_OrdDetailDto newData)
        {
            newData.OrdDetailId = Guid.NewGuid().ToSequentialGuid();


            var result = Insert(newData);

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

            return(result);
        }