private void GetDatas() { Inspect_Spec_MasterService sservice = new Inspect_Spec_MasterService(); if (!(GlobalUsage.WorkOrderNo == "설정안됨")) { dgvInspect.DataSource = sservice.GetAllByWcCode(GlobalUsage.WcCode, GlobalUsage.ItemCode); } else { } }
private void BtnSave_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(txtInspect_code.Text) && !string.IsNullOrEmpty(txtInspect_name.Text)) { Inspect_Spec_MasterService service = new Inspect_Spec_MasterService(); List <InspectSpecVO> additem = new List <InspectSpecVO>(); InspectSpecVO inspect = new InspectSpecVO { Item_Code = lblItem.Text.Trim(), Process_code = lblProcess.Text.Trim(), Inspect_code = txtInspect_code.Text.Trim(), Inspect_name = txtInspect_name.Text.Trim(), //Spec_Desc = , USL = nudusl.Value, SL = nudsl.Value, LSL = nudlsl.Value, Sample_size = Convert.ToInt32(nudsample.Value), Inspect_Unit = txttype.Text.Trim(), Remark = txtRemark.Text.Trim() }; additem.Add(inspect); if (service.InsertInspectSpec(additem)) { this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("이미 등록된 검사항목입니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } else { MessageBox.Show("필수 항목을 입력하세요.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } catch (Exception err) { Program.Log.WriteError(err.Message); } }