Пример #1
0
        public BaseApiResponse InsertOrderNotes(OrderNoteEntity modal)
        {
            var response = new BaseApiResponse();

            try
            {
                Guid           UserId = new Guid(modal.UserId);
                SqlParameter[] param  = { new SqlParameter("OrderId", (object)modal.OrderId ?? (object)DBNull.Value)
                                          ,                            new SqlParameter("PartNo", (object)modal.PartNo ?? (object)DBNull.Value)
                                          ,                            new SqlParameter("NotesClient", (object)modal.NotesClient ?? (object)DBNull.Value)
                                          ,                            new SqlParameter("NotesInternal", (object)modal.NotesInternal ?? (object)DBNull.Value)
                                          ,                            new SqlParameter("UserId", (object)UserId ?? (object)DBNull.Value) };
                var            result = _repository.ExecuteSQL <int>("InsertOrderNotes", param).FirstOrDefault();
                if (result == 1)
                {
                    response.Success    = true;
                    response.InsertedId = result;
                }
                else
                {
                    response.Success = false;
                }
            }
            catch (Exception ex)
            {
                response.Message.Add(ex.Message);
            }
            return(response);
        }
Пример #2
0
        /// <summary>
        ///  删除
        /// </summary>
        /// <param name="id"></param>
        public virtual void Remove(long id)
        {
            var info = new OrderNoteEntity {
                Id = id, SaveType = SaveType.Remove
            };

            Ioc.Resolve <IApplicationService, OrderNoteEntity>().Save(info);
            LoadEntities();
        }
Пример #3
0
        /// <summary>
        /// 保存
        /// </summary>
        public virtual void Save()
        {
            var info = new OrderNoteEntity
            {
                Content = txtContent.Value.Trim(),
                Order   = new OrderEntity {
                    Id = Request.QueryString["OrderId"].Convert <long>()
                },
                Account = new AccountEntity {
                    Id = Identity.Id
                },
                SaveType = SaveType.Add
            };
            var rev = Ioc.Resolve <IApplicationService, OrderNoteEntity>().Save(info);

            Message1.ShowMessage(info.Errors);
            if (rev)
            {
                LoadEntities();
                txtContent.Value = "";
            }
        }