Ejemplo n.º 1
0
 void SetOrderState()
 {
     tsbCommit.Enabled  = _sampleOrder.CheckOrderState < CheckOrderStateEnum.Complete;
     tsbApprove.Enabled = _sampleOrder.CheckOrderState == CheckOrderStateEnum.Complete;
     //发布前的样品数都可以改
     tsbAllPass.Enabled = tsbSampleCount.Enabled = _sampleOrder.CheckOrderState <= CheckOrderStateEnum.Complete;
     if (_sampleOrder.CheckOrderState == CheckOrderStateEnum.Submit ||
         _sampleOrder.CheckOrderState == CheckOrderStateEnum.Running ||
         _sampleOrder.CheckOrderState == CheckOrderStateEnum.Complete)
     {
         SetPageEnable(true);
     }
     else
     {
         SetPageEnable(false);
     }
     _Grid.Refresh();
     //_sampleOrderGrid.ReloadRow(1);
 }
Ejemplo n.º 2
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            if (OrderGV.SelectedItems.Count == 1)
            {
                //修改
                var order = OrderGV.SelectedItems[0];

                DefInOrderModifyForm form = new DefInOrderModifyForm(order);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    OrderGV.Refresh(true);
                }
                ;
            }
            else
            {
                MessageBox.Show("请选择单行数据进行修改");
                return;
            }
        }
Ejemplo n.º 3
0
        private void tsbDiscard_Click(object sender, EventArgs e)
        {
            if (OrderGV.SelectedItems != null && OrderGV.SelectedItems.Count > 0)
            {
                if (System.Windows.Forms.DialogResult.No == System.Windows.Forms.MessageBox.Show("确定废弃?"
                                                                                                 , "注意", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question))
                {
                    return;
                }
                var Datas = new EncodeCollection <CheckOrder>();
                for (int i = 0; i < OrderGV.SelectedItems.Count; i++)
                {
                    var order = OrderGV.SelectedItems[i];

                    order.CheckOrderState = CheckOrderStateEnum.Discard;
                    //var Helper = new QueryHelper<RetainedSampleOrderItem>();
                    //Helper.Add();
                    order.State = DataState.Changed;
                    Datas.Add(order);
                }
                Datas.SaveDatas();
                OrderGV.Refresh(OrderGV.Datas);
            }
        }