Example #1
0
        private void LoadList()
        {
            MoldingService service = new MoldingService();

            List = service.GetMoldingInfo();
            dgvSearchResult.DataSource = List;
        }
Example #2
0
        private void BtnModify_Click(object sender, EventArgs e)
        {
            detailList[0].Mold_Code       = txtMoldCodeM.Text;
            detailList[0].Mold_Name       = txtMoldNameM.Text;
            detailList[0].Mold_Group      = cmbMoldGroupM.SelectedValue.ToString(); //
            detailList[0].Guar_Shot_Cnt   = int.Parse(txtWarrentNumM.Text);
            detailList[0].Purchase_Amt    = int.Parse(txtPriceM.Text);
            detailList[0].In_Date         = dtpInputdateM.Value;
            detailList[0].Last_Setup_Time = dtpLastEquipDateM.Value;
            if (rbUseM.Checked)
            {
                detailList[0].Use_YN = "Y";
            }
            else
            {
                detailList[0].Use_YN = "N";
            }

            MoldingService ser    = new MoldingService();
            int            result = ser.UpdateMoldingInfo(detailList[0]);

            if (result >= 1)
            {
                MessageBox.Show("수정이 완료되었습니다.");
            }
        }
Example #3
0
        private void LoadList()
        {
            MoldingService service = new MoldingService();

            list = service.MoldUseHistory();
            dgvSearchResult.DataSource = list;
        }
Example #4
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            string strStart = dtpStart.Value.ToString();
            string strEnd   = dtpEnd.Value.ToString();

            MoldingService ser = new MoldingService();

            if (fcItem.SendCode == null)
            {
                if (fcWorkPlace.SendCode == null)
                {
                    list = ser.SearchMoldUse(strStart, strEnd, "", "");
                    dgvSearchResult.DataSource = list;
                }
                else
                {
                    list = ser.SearchMoldUse(strStart, strEnd, "", fcWorkPlace.SendCode);
                    dgvSearchResult.DataSource = list;
                }
            }
            else
            {
                if (fcWorkPlace.SendCode == null)
                {
                    list = ser.SearchMoldUse(strStart, strEnd, fcItem.SendCode, "");
                    dgvSearchResult.DataSource = list;
                }
                else
                {
                    list = ser.SearchMoldUse(strStart, strEnd, fcItem.SendCode, fcWorkPlace.SendCode);
                    dgvSearchResult.DataSource = list;
                }
            }
            if (list.Count < 1)
            {
                frm.lblAlert.Text = "[알람] 검색한 조건의 데이터가 존재하지 않습니다.";
                return;
            }
            frm.lblAlert.Text = $"[알람] {list.Count} 건의 데이터가 조회되었습니다.";
            timer1.Start();
            dgvSearchResult.DataSource = list;
        }
Example #5
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            MoldingService ser = new MoldingService();

            if (rbUse.Checked)
            {
                isUse = "Y";
            }
            else
            {
                isUse = "N";
            }
            if (int.TryParse(txtPrice.Text, out int price) && int.TryParse(txtWarrentNum.Text, out int warrentNum))
            {
                int result = ser.SaveMoldingInfo(txtMoldCodeInput.Text, txtMoldNameInput.Text, cmbMoldGroupI.SelectedValue.ToString(), int.Parse(txtPrice.Text), dtpInputdate.Value.ToString().Substring(0, 10), dtpLastEquipDate.Value.ToString().Substring(0, 10), int.Parse(txtWarrentNum.Text), txtPS.Text, isUse);
                if (result >= 1)
                {
                    MessageBox.Show("저장이 완료되었습니다.");
                    txtMoldCodeInput.Text       = null;
                    txtMoldNameInput.Text       = null;
                    cmbMoldGroupI.SelectedValue = 0;
                    txtWarrentNum.Text          = null;
                    txtPrice.Text          = null;
                    dtpInputdate.Value     = DateTime.Now;
                    dtpLastEquipDate.Value = DateTime.Now;
                    rbUse.Checked          = false;
                    rbNoUse.Checked        = false;
                    LoadList();
                }
                else
                {
                    MessageBox.Show("오류.");
                }
            }
            else
            {
                MessageBox.Show("정확한 값을 입력해 주세요.");
            }
        }
Example #6
0
        private void DgvSearchResult_DoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            tcParent2.SelectedIndex = 1;
            MoldingService service = new MoldingService();

            detailList                 = service.GetMoldingInfoDetail(selected);
            txtMoldCodeM.Text          = detailList[0].Mold_Code;
            txtMoldNameM.Text          = detailList[0].Mold_Name;
            cmbMoldGroupM.Text         = "";
            cmbMoldGroupM.SelectedText = detailList[0].Mold_Group; //
            txtWarrentNumM.Text        = detailList[0].Guar_Shot_Cnt.ToString();
            txtPriceM.Text             = detailList[0].Purchase_Amt.ToString();
            dtpInputdateM.Value        = detailList[0].In_Date;
            dtpLastEquipDateM.Value    = detailList[0].Last_Setup_Time;
            txtPSM.Text                = detailList[0].Remark;
            if (detailList[0].Use_YN.ToString() == "Y")
            {
                rbUseM.Checked = true;
            }
            else
            {
                rbNoUseM.Checked = true;
            }
        }
Example #7
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            MoldingService ser = new MoldingService();

            if (txtMoldCodeSearch.Text != "")
            {
                if (txtMoldNameSearch.Text != "")
                {
                    if (cmbMoldGroupSearch.Text != "선택")
                    {
                        List = ser.SearchMoldingInfo(txtMoldCodeSearch.Text, txtMoldNameSearch.Text, cmbMoldGroupSearch.Text);
                    }
                    else
                    {
                        List = ser.SearchMoldingInfo(txtMoldCodeSearch.Text, txtMoldNameSearch.Text, "");
                    }
                }
                else
                {
                    if (cmbMoldGroupSearch.Text != "선택")
                    {
                        List = ser.SearchMoldingInfo(txtMoldCodeSearch.Text, "", cmbMoldGroupSearch.Text);
                    }
                    else
                    {
                        List = ser.SearchMoldingInfo(txtMoldCodeSearch.Text, "", "");
                    }
                }
            }
            else
            {
                if (txtMoldNameSearch.Text != "")
                {
                    if (cmbMoldGroupSearch.Text != "선택")
                    {
                        List = ser.SearchMoldingInfo("", txtMoldNameSearch.Text, cmbMoldGroupSearch.Text);
                    }
                    else
                    {
                        List = ser.SearchMoldingInfo("", txtMoldNameSearch.Text, "");
                    }
                }
                else
                {
                    if (cmbMoldGroupSearch.Text != "선택")
                    {
                        List = ser.SearchMoldingInfo("", "", cmbMoldGroupSearch.Text);
                    }
                    else
                    {
                        List = ser.SearchMoldingInfo("", "", "");
                    }
                }
            }
            if (List.Count < 1)
            {
                //frm.lblAlert.Text = "[알람] 검색한 조건의 데이터가 존재하지 않습니다.";
                return;
            }
            //frm.lblAlert.Text = $"[알람] {List.Count} 건의 데이터가 조회되었습니다.";
            timer1.Start();
            dgvSearchResult.DataSource = List;
        }