Ejemplo n.º 1
0
        /// <summary>
        /// 검사항목규격설정 사용
        /// </summary>
        /// <returns></returns>
        public bool UseInspectSpec(InspectSpecVO inspect, string use)
        {
            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = new SqlConnection(Connstr);
                    cmd.CommandText = $"UPDATE Inspect_Spec_Master SET Use_YN ='{use}'  WHERE Item_Code =@Item_Code AND Process_code=@Process_code AND Inspect_code=@Inspect_code";
                    cmd.CommandType = CommandType.Text;

                    cmd.Connection.Open();
                    cmd.Parameters.AddWithValue("@Item_Code", inspect.Item_Code);
                    cmd.Parameters.AddWithValue("@Process_code", inspect.Process_code);
                    cmd.Parameters.AddWithValue("@Inspect_code", inspect.Inspect_code);
                    int resualt = cmd.ExecuteNonQuery();
                    cmd.Connection.Close();

                    return(resualt > 0);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 검사항목규격설정 사용
 /// </summary>
 /// <returns></returns>
 public bool UseInspectSpec(InspectSpecVO inspect, string use)
 {
     return(dac.UseInspectSpec(inspect, use));
 }