Ejemplo n.º 1
0
 private void btn_work_inst_srch_Click(object sender, EventArgs e)
 {
     try
     {
         if (rBtn_lot.Checked)
         {
             SrchValue = ComInfo.TextBoxMessage("LOT번호 입력", "입력");
             if (!SrchValue.Equals(""))
             {
                 ResetSetting();
                 Srch_by_LotNo(SrchValue);
             }
         }
         else if (rBtn_a_union.Checked)
         {
             SrchValue = ComInfo.TextBoxMessage("묶음코드(제품)", "입력");
             if (!SrchValue.Equals(""))
             {
                 ResetSetting();
                 Srch_by_a_union(SrchValue);
             }
         }
         else if (rBtn_union.Checked)
         {
             SrchValue = ComInfo.TextBoxMessage("개체번호(원료육)", "입력");
             if (!SrchValue.Equals(""))
             {
                 ResetSetting();
                 Srch_by_union(SrchValue);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("검색중 오류가 발생했습니다");
         Console.WriteLine(ex);
         return;
     }
 }
Ejemplo n.º 2
0
        private void btn_work_inst_srch_Click(object sender, EventArgs e)
        {
            try
            {
                if (rBtn_s_lot.Checked)
                {
                    SrchValue = ComInfo.TextBoxMessage("납품LOT번호", "입력");
                    if (!SrchValue.Equals(""))
                    {
                        string valueTemp = SrchValue;
                        txt_srch_value.Text = SrchValue;
                        txt_rBtn_value.Text = rBtn_s_lot.Text;

                        if (valueTemp.Length == 9) //200103001
                        {
                            string date = "";
                            string cd   = "";
                            try
                            {
                                decimal.Parse(valueTemp); // 양식 체크용
                                date = "20" + valueTemp.Substring(0, 2) + "-" + valueTemp.Substring(2, 2) + "-" + valueTemp.Substring(4, 2);
                                cd   = int.Parse(valueTemp.Substring(6, 3)).ToString();
                                ResetSetting();
                                SrchValue = "and S.SALES_DATE = '" + date + "'   AND S.SALES_CD = '" + cd + "'   ";
                                Srch_List();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("입력 양식이 올바르지 않습니다 ( 9자리 )");
                                return;
                            }
                        }
                        else
                        {
                            MessageBox.Show("입력 양식이 올바르지 않습니다 ( 9자리 )");
                        }
                    }
                }
                else if (rBtn_lot.Checked)
                {
                    SrchValue = ComInfo.TextBoxMessage("공정LOT번호", "입력");
                    if (!SrchValue.Equals(""))
                    {
                        txt_srch_value.Text = SrchValue;
                        txt_rBtn_value.Text = rBtn_lot.Text;
                        ResetSetting();
                        SrchValue = "and II.LOT_NO = '" + SrchValue + "' ";
                        Srch_List();
                    }
                }
                else if (rBtn_a_union.Checked)
                {
                    SrchValue = ComInfo.TextBoxMessage("묶음코드(제품)", "입력");
                    if (!SrchValue.Equals(""))
                    {
                        txt_srch_value.Text = SrchValue;
                        txt_rBtn_value.Text = rBtn_a_union.Text;
                        ResetSetting();
                        SrchValue = "and A_UNION_CD = '" + SrchValue + "' ";
                        Srch_List();
                    }
                }
                else if (rBtn_srch_item.Checked)
                {
                    Popup.pop_sf_제품검색 msg = new Popup.pop_sf_제품검색();
                    msg.ShowDialog();

                    if (msg.sCode != null && !msg.sCode.Equals(""))
                    {
                        SrchValue           = msg.sCode;
                        txt_srch_value.Text = msg.sLabelNM;
                        txt_rBtn_value.Text = rBtn_srch_item.Text;
                        ResetSetting();
                        SrchValue = "and ID.ITEM_CD  = '" + SrchValue + "' and S.SALES_DATE >= '" + txt_start_date.Text + "'  and S.SALES_DATE <= '" + txt_end_date.Text + "'   ";
                        Srch_List();
                    }
                }
                else if (rBtn_srch_cust.Checked)
                {
                    Popup.pop거래처검색 msg = new Popup.pop거래처검색();
                    msg.sCustGbn = "1";
                    msg.ShowDialog();

                    if (msg.sCode != null && !msg.sCode.Equals(""))
                    {
                        SrchValue           = msg.sCode;
                        txt_srch_value.Text = msg.sName;
                        txt_rBtn_value.Text = rBtn_srch_cust.Text;
                        ResetSetting();
                        SrchValue = "and CN.CUST_CD = '" + SrchValue + "' and S.SALES_DATE >= '" + txt_start_date.Text + "'  and S.SALES_DATE <= '" + txt_end_date.Text + "'   ";
                        Srch_List();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("검색중 오류가 발생했습니다");
                Console.WriteLine(ex);
                return;
            }
        }