Ejemplo n.º 1
0
        public void Create(MES_M001_Order MES_M001_Order)
        {
            MES_M001_Order.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M001_Order.CreateUser = tempUser.UserName;
            MES_M001_Order.CompCode   = tempUser.CompCode;
            MES_M001_Order.Validate();
            this.MES_M001_OrderRepository.Add(MES_M001_Order);
            this.runtimeService.Commit();
        }
Ejemplo n.º 2
0
        public void Update(MES_M001_Order MES_M001_Order)
        {
            MES_M001_Order.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M001_Order.ModifyUser = tempUser.UserName;
            MES_M001_Order.Validate();
            var existstb_Sys_Menu = this.GetById(MES_M001_Order.Id);

            this.MES_M001_OrderRepository.SetValues(MES_M001_Order, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
Ejemplo n.º 3
0
        private void EditForm(string formText, string btnCommand)
        {
            MES_M001_Order temp = mESM001OrderBindingSource.Current as MES_M001_Order;
            OrderEditForm  edit = new OrderEditForm(temp);

            edit.Text = formText;
            edit.Tag  = btnCommand;
            if (edit.ShowDialog() != DialogResult.OK)
            {
                mESM001OrderBindingSource.CancelEdit();
            }
        }
Ejemplo n.º 4
0
        public void Save(MES_M001_Order order, List <MES_M001_Order_Detail> orderDetailList)
        {
            tb_Sys_User tempUser    = appCacheService.GetItem("user") as tb_Sys_User;
            var         existsorder = this.GetById(order.Id);

            if (existsorder == null)
            {
                order.CompCode   = tempUser.CompCode;
                order.CreateDt   = DateTime.Now;
                order.CreateUser = tempUser.UserName;
                order.Validate();
                this.MES_M001_OrderRepository.Add(order);
            }
            else
            {
                order.ModifyDt   = DateTime.Now;
                order.ModifyUser = tempUser.UserName;
                order.Validate();
                this.MES_M001_OrderRepository.SetValues(order, existsorder);
            }
            if (orderDetailList != null)
            {
                foreach (var orderDetail in orderDetailList)
                {
                    var existstorderDetail = this.orderDetailRepository.GetByID(orderDetail.Id);
                    if (existstorderDetail == null)
                    {
                        orderDetail.CompCode   = tempUser.CompCode;
                        orderDetail.CreateDt   = DateTime.Now;
                        orderDetail.CreateUser = tempUser.UserName;
                        orderDetail.Validate();
                        this.orderDetailRepository.Add(orderDetail);
                    }
                    else
                    {
                        orderDetail.ModifyDt   = DateTime.Now;
                        orderDetail.ModifyUser = tempUser.UserName;
                        orderDetail.Validate();
                        this.orderDetailRepository.SetValues(orderDetail, existstorderDetail);
                    }
                }
            }
            this.runtimeService.Commit();
        }
Ejemplo n.º 5
0
 public OrderEditForm(MES_M001_Order orderData)
 {
     InitializeComponent();
     this.orderData = orderData;
     //this.mESM001OrderDetailBindingSource.DataSource =
 }