Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            WorkOrderService service = new WorkOrderService();

            if (nuDefaultQty.Value < nuPlanQty.Value)
            {
                MessageBox.Show("잔여수량 보다 계획수량의 양이 많습니다. 다시 확인하세요.");
                return;
            }
            int count = service.GetAllWorkDetail(txtWorkReqNo.Text).FindAll(x => x.Process_name == pType).Count;

            WorkOrderInsVo insVo = new WorkOrderInsVo
            {
                Item_Name      = txtIem.Text,
                Workorderno    = string.Format($"{txtWorkReqNo.Text}_No{pType}{count + 1}"),
                Plan_Date      = dtpPlanStart.Value.Date,
                Plan_Starttime = Convert.ToDateTime($"{dtpPlanStart.Value.ToShortDateString()} {String.Format("{0:tt HH:mm}", dtpStartTime.Value)}"),
                Plan_Endtime   = Convert.ToDateTime($"{dtpPlanStart.Value.ToShortDateString()} {String.Format("{0:tt HH:mm}", dtpEndTime.Value)}"),
                Plan_Qty       = Convert.ToInt32(nuPlanQty.Value),
                Wc_Code        = cbWorkCenter.SelectedValue.ToString(),
                Wo_Req_No      = txtWorkReqNo.Text
            };

            bool isChecked = service.InsertWorkOrder(insVo);

            if (!isChecked)
            {
                MessageBox.Show("등록에 실패하였습니다. 정보를 확인하세요.");
                return;
            }
            MessageBox.Show("등록되었습니다.");
            this.Close();
        }
Пример #2
0
        private void setAction()
        {
            WorkOrderService service        = new WorkOrderService();
            List <WorkOrder> workDetailList = service.GetAllWorkDetail(dgvProductRequset.SelectedRows[0].Cells[1].Value.ToString());

            WorkOrderDetailView(workDetailList);
        }