private string getROrderSeq(string sNo)
        {
            string sql = @"select UF_ROrderSeqGenerator('" + sNo + "')";

            MariaCRUD m = new MariaCRUD();

            string msg = string.Empty;

            return(m.dbRonlyOne(sql, ref msg).ToString());
        }
        private string getCustCode()
        {
            string sql = @"select UF_CustCodeGenerator('A')";

            MariaCRUD m = new MariaCRUD();

            string msg = string.Empty;

            return(m.dbRonlyOne(sql, ref msg).ToString());
        }
Esempio n. 3
0
        private string getDeliNo()
        {
            string sql = @"select UF_DeliveryNoGenerator('" + G.Pos + "')";

            MariaCRUD m = new MariaCRUD();

            string msg = string.Empty;

            return(m.dbRonlyOne(sql, ref msg).ToString());
        }
        private string getProcessNo(string _kind)
        {
            string sql = @"select UF_ProcessNoGenerator('" + _kind + "')";

            MariaCRUD m = new MariaCRUD();

            string msg = string.Empty;

            return(m.dbRonlyOne(sql, ref msg).ToString());
        }
        private void Save()
        {
            lblMsg.Text = "";

            if (tbProd.Tag == null)
            {
                lblMsg.Text = "품목명을 선택해 주세요.";
                lblProd.Focus();
                return;
            }

            string sProd = tbProd.Tag.ToString();
            string sQty  = tbQty.Text.Replace(",", "").Trim();

            if (String.IsNullOrEmpty(sQty))
            {
                lblMsg.Text = "조정수량을 입력해 주세요.";
                tbQty.Focus();
                return;
            }

            string sDate     = dtpDate.Value.ToString("yyyy-MM-dd");
            string sDepot    = cbDepot.SelectedValue.ToString();
            string sKind     = cbKind.SelectedValue.ToString();
            string sContents = tbContents.Text.Trim();

            string    sql = string.Empty;
            string    msg = string.Empty;
            MariaCRUD m   = new MariaCRUD();

            sql = "insert into tb_stock_move (pos, move_date, depot, prod_id, move_kind, move_qty, contents, enter_man) " +
                  "values('" + G.Pos + "','" + sDate + "','" + sDepot + "','" + sProd + "','" + sKind + "'," + sQty + ",'" + sContents + "','" + G.UserID + "')";

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                lblMsg.Text = msg;
                return;
            }

            parentWin.ListSearch();

            for (int i = 0; i < parentWin.dataGridView1.Rows.Count; i++)
            {
                if (parentWin.dataGridView1.Rows[i].Cells[2].Value.ToString() == sProd)
                {
                    parentWin.dataGridView1.CurrentCell          = parentWin.dataGridView1[0, i];
                    parentWin.dataGridView1.CurrentCell.Selected = true;
                    break;
                }
            }

            this.DialogResult = DialogResult.OK;
        }
Esempio n. 6
0
        private void pbSave_Click(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            string sName      = tbName.Text.Trim();
            string sCeo       = tbCeo.Text.Trim();
            string sHomePage  = tbHomePage.Text.Trim();
            string sBusiNo    = tbBusiNo.Text.Trim();
            string sBubinNo   = tbBubinNo.Text.Trim();
            string sUpTae     = tbUpTae.Text.Trim();
            string sJongMong  = tbJongMong.Text.Trim();
            string sPostNo    = tbPostNo.Text.Trim();
            string sAddr1     = tbAddr1.Text.Trim();
            string sAddr2     = tbAddr2.Text.Trim();
            string sTel       = tbTel.Text.Trim();
            string sFax       = tbFax.Text.Trim();
            string sStartTime = mtbJobStartTime.Text.Trim();

            if (string.IsNullOrEmpty(sName))
            {
                lblMsg.Text = "회사공식명을 입력해 주세요.";
                tbName.Focus();
                return;
            }

            if (sStartTime == ":")
            {
                sStartTime = "00:00";
            }

            if (sStartTime.Length != 5)
            {
                lblMsg.Text = "작업시작시간을 확인해 주세요.";
                mtbJobStartTime.Focus();
                return;
            }
            sStartTime = sStartTime + ":00";

            string sql = "update tb_sys_pos " +
                         "set pos_name = '" + sName + "', ceo = '" + sCeo + "', homepage = '" + sHomePage + "', busi_no = '" + sBusiNo + "', bubin_no = '" + sBubinNo + "', uptae = '" + sUpTae + "', jongmog = '" + sJongMong + "', post_no = '" + sPostNo + "', address1 = '" + sAddr1 + "', address2 = '" + sAddr2 + "', tel = '" + sTel + "', fax = '" + sFax + "', job_starttime = TIME_TO_SEC('" + sStartTime + "'), enter_dt = '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', enter_man = '" + G.UserID + "' " +
                         "where pos = 'A'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                lblMsg.Text = msg;
                return;
            }

            lblMsg.Text = "저장되었습니다.";
        }
        private void pbDel_Click(object sender, EventArgs e)
        {
            if (G.Authority == "D")
            {
                return;
            }

            if (!cbNo.Checked)
            {
                lblMsg.Text = "삭제할 수주번호를 체크해 주세요.";
                return;
            }

            string sNo = tbNo.Text;

            if (string.IsNullOrEmpty(sNo))
            {
                lblMsg.Text = "저장된 수주번호만 삭제할 수 있습니다.";
                return;
            }

            DialogResult dr = MessageBox.Show("수주번호 : " + sNo + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_rorder_main where rorder_id = '" + sNo + "'";
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }

            //string sEstimateNo = tbEstimateNo.Text;
            //if (!string.IsNullOrEmpty(sEstimateNo))
            //{
            //    sql = "update tb_estimate_main set rorder_flag = 0 where estimate_id = '" + sEstimateNo + "'";
            //    m.dbCUD(sql, ref msg);
            //    sql = "update tb_estimate_sub set rorder_flag = 0 where estimate_id = '" + sEstimateNo + "'";
            //    m.dbCUD(sql, ref msg);
            //}

            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sNo + " " + tbCust.Text);

            ListSearch1();
            ListInit();
        }
Esempio n. 8
0
        protected void ufConnection()
        {
            lblMsg.Text = "";

            string empPwd = tbPWD.Text.Trim();

            if (String.IsNullOrEmpty(empPwd))
            {
                lblMsg.Text = "패스워드를 입력하세요.";
                tbPWD.Focus();
                return;
            }

            G.UserID = cbID.SelectedValue.ToString();

            string sql = @"select po.pos, po.com_name, po.pos_name, us.user_name, us.pwd, us.authority " +
                         "from tb_sys_user us inner join tb_sys_pos po on us.pos = po.pos " +
                         "where us.user_id = '" + G.UserID + "'";

            MariaCRUD m     = new MariaCRUD();
            string    msg   = string.Empty;
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }

            DataRow[] row = table.Select();
            string    strPwd;

            if (row.Length > 0)
            {
                strPwd = row[0][4].ToString();

                if (new MyClass().EncryptSHA512(empPwd) != strPwd)
                {
                    lblMsg.Text = "패스워드가 정확하지 않습니다.";
                    tbPWD.Focus();
                    return;
                }

                G.Pos       = row[0][0].ToString();
                G.ComName   = row[0][1].ToString();
                G.PosName   = row[0][2].ToString();
                G.UserName  = row[0][3].ToString();
                G.Authority = row[0][5].ToString();

                WriteRegistry(G.UserID);
                m.TransLogCreate(G.Authority, G.UserID, "I", "FormLogin", "Login", "로그인");
                this.DialogResult = DialogResult.OK;
            }
        }
Esempio n. 9
0
        private void pbDel_Click(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            int    index  = 0;
            string sID    = string.Empty;
            string sName  = string.Empty;
            string sModel = string.Empty;

            try
            {
                index  = dataGridView1.CurrentRow.Index;
                sID    = dataGridView1.Rows[index].Cells[0].Value.ToString();
                sName  = dataGridView1.Rows[index].Cells[2].Value.ToString();
                sModel = dataGridView1.Rows[index].Cells[3].Value.ToString();

                if (dataGridView1.Rows[index].Selected != true)
                {
                    MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            DialogResult dr = MessageBox.Show(sName + "\r" + sModel + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_machinecard where machine_id = " + sID;
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }

            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sName + " " + sModel);

            ListSearch();
            MachineInit();
        }
Esempio n. 10
0
        private void pbDel_Click(object sender, EventArgs e)
        {
            if (G.Authority == "D")
            {
                return;
            }

            if (!cbNo.Checked)
            {
                lblMsg.Text = "삭제할 전표번호를 체크해 주세요.";
                return;
            }

            string sNo = tbNo.Text;

            if (string.IsNullOrEmpty(sNo))
            {
                lblMsg.Text = "저장된 전표번호만 삭제할 수 있습니다.";
                return;
            }

            DialogResult dr = MessageBox.Show("전표번호 : " + sNo + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_delivery_main where deli_id = '" + sNo + "'";
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show("전표번호 : '" + sNo + "'\r\r이미 타 업무에서 사용중인 전표번호이므로,\r삭제할 수 없습니다.");
                return;
            }

            string sROrderNo = tbROderNo.Text;

            if (!string.IsNullOrEmpty(sROrderNo))
            {
                sql = "update tb_rorder_sub set deli_flag = 0 where rorder_id = '" + sROrderNo + "'";
                m.dbCUD(sql, ref msg);
            }

            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sNo + " " + tbProject.Text);

            ListSearch1();
            ListInit();
        }
Esempio n. 11
0
        private void pbDel_Click(object sender, EventArgs e)
        {
            int    index     = 0;
            string sDate     = string.Empty;
            string sDepot    = string.Empty;
            string sProd     = string.Empty;
            string sProdName = string.Empty;

            try
            {
                index     = dataGridView1.CurrentRow.Index;
                sDate     = udY.Value.ToString() + "-12-31";
                sDepot    = cbDepot.SelectedValue.ToString();
                sProd     = dataGridView1.Rows[index].Cells[1].Value.ToString();
                sProdName = dataGridView1.Rows[index].Cells[3].Value.ToString();

                if (dataGridView1.Rows[index].Selected != true)
                {
                    MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            DialogResult dr = MessageBox.Show(sProdName + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_gi_pdclose where pos = '" + G.Pos + "' and close_date = '" + sDate + "' and depot = '" + sDepot + "' and prod_id = '" + sProd + "'";
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }

            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, udY.Value.ToString() + " " + sProdName);

            ListSearch();
        }
        private void pbDel_Click(object sender, EventArgs e)
        {
            int    index     = 0;
            string sNo       = string.Empty;
            string sCustName = string.Empty;
            string sProdName = string.Empty;
            string sAddName  = string.Empty;

            try
            {
                index     = dataGridView1.CurrentRow.Index;
                sNo       = dataGridView1.Rows[index].Cells[0].Value.ToString();
                sCustName = dataGridView1.Rows[index].Cells[3].Value.ToString();
                sProdName = dataGridView1.Rows[index].Cells[5].Value.ToString();
                sAddName  = dataGridView1.Rows[index].Cells[6].Value.ToString();

                if (dataGridView1.Rows[index].Selected != true)
                {
                    MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            DialogResult dr = MessageBox.Show(sNo + "\r" + sCustName + "\r(" + sProdName + "-" + sAddName + ")\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_purchase_toll where purch_id = '" + sNo + "'";
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }

            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sNo + " " + sCustName + " (" + sProdName + "-" + sAddName + ")");

            ListSearch();
        }
        private void P1A04_PROCESS_SUB_Load(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            string    sql   = @"select co_code, co_item from tb_gi_common where co_kind = 'D' order by co_code";
            MariaCRUD m     = new MariaCRUD();
            string    msg   = string.Empty;
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbKind.DataSource    = table;
                cbKind.ValueMember   = "co_code";
                cbKind.DisplayMember = "co_item";
            }

            cbKind.SelectedIndex = parentWin.cbStd.SelectedIndex;

            if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]")
            {
                cbGroup.Text       = "A.CNC";
                this.ActiveControl = tbName;
            }
            else
            {
                rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex;

                procStd     = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString();
                procNo      = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString();
                tbNo.Text   = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString();
                tbName.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString();
                tbTool.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString();

                string sTime = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString();
                if (!string.IsNullOrEmpty(sTime))
                {
                    tbTime.Text = float.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString()).ToString("0.0");
                }

                cbGroup.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString();
                string sFinal = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString();
                if (sFinal == "O")
                {
                    ckFinalFlag.Checked = true;
                }

                cbKind.Enabled     = false;
                tbNo.Enabled       = false;
                this.ActiveControl = tbName;
            }
        }
        private void pbDel_Click(object sender, EventArgs e)
        {
            int    index     = 0;
            string sID       = string.Empty;
            string sDate     = string.Empty;
            string sCustName = string.Empty;

            try
            {
                index     = dataGridView1.CurrentRow.Index;
                sID       = dataGridView1.Rows[index].Cells[0].Value.ToString();
                sDate     = DateTime.Parse(dataGridView1.Rows[index].Cells[5].Value.ToString()).ToString("yyyy-MM-dd");
                sCustName = dataGridView1.Rows[index].Cells[2].Value.ToString();

                if (dataGridView1.Rows[index].Selected != true)
                {
                    MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("삭제 정보가 선택되지 않았습니다.", this.lblTitle.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            DialogResult dr = MessageBox.Show(sID + "\r" + sDate + "\r" + sCustName + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_qc_claim where claim_id = " + sID;
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }

            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sID + " " + sDate + " " + sCustName);

            ListSearch();
        }
Esempio n. 15
0
        private void FormLogin_Load(object sender, EventArgs e)
        {
            //if (!IsRunningAsAdministrator())
            //{
            //    ProcessStartInfo processStartInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().CodeBase);
            //    {
            //        var withBlock = processStartInfo;
            //        withBlock.UseShellExecute = true;
            //        withBlock.Verb = "runas";
            //        Process.Start(processStartInfo);
            //        Application.Exit();
            //    }
            //}

            //

            timer1.Start();
            lblMsg.Text = "";

            string    sql = @"select com_name from tb_sys_pos where pos = 'A'";
            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            string    com = m.dbRonlyOne(sql, ref msg).ToString();

            if (msg == "OK")
            {
                lblCompany.Text = com;
            }
            else
            {
                lblCompany.Text = "";
            }

            sql = @"select user_id, concat(user_name, if(authority='B',' (관리자)','')) as user_name from tb_sys_user where user_flag = 1 order by authority, user_id";
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbID.DataSource    = table;
                cbID.ValueMember   = "user_id";
                cbID.DisplayMember = "user_name";
            }

            string ID = string.Empty;

            if (ReadRegistry(ref ID))
            {
                cbID.SelectedValue = ID;
            }
        }
        private void P1ED03_QC_AS_SUB_Load(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            string sql = @"select user_id, user_name from tb_sys_user where authority in ('B','C') and user_flag = 1 order by user_name";
            MariaCRUD m = new MariaCRUD();
            string msg = string.Empty;
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbCharge.DataSource = table;
                cbCharge.ValueMember = "user_id";
                cbCharge.DisplayMember = "user_name";
            }


            if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]")
            {
                cbState.SelectedIndex = 1; //처리중
                cbCharge.SelectedValue = G.UserID;
                this.ActiveControl = lblDeliID;
            }
            else
            {
                try
                {
                    rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex;

                    tbNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString();
                    cbState.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[12].Value.ToString();
                    tbDeli.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[13].Value.ToString();
                    tbQty.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString();
                    dtpClaimDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString());
                    tbClaimContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString();
                    dtpActionDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString());
                    tbActionContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[8].Value.ToString();
                    tbMoney.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[9].Value.ToString();
                    cbCharge.SelectedValue = parentWin.dataGridView1.Rows[rowIndex].Cells[10].Value.ToString();

                    this.ActiveControl = btnSave;
                }
                catch (FormatException)
                {
                    return;
                }
            }
        }
        private void P1A05_STOCK_MOVE_SUB_Load(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            string    sql   = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code";
            MariaCRUD m     = new MariaCRUD();
            string    msg   = string.Empty;
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbDepot.DataSource    = table;
                cbDepot.ValueMember   = "co_code";
                cbDepot.DisplayMember = "co_item";
            }

            cbDepot.SelectedIndex = parentWin.cbDepot.SelectedIndex;

            sql   = @"select co_code, co_item from tb_gi_common where co_kind = 'E' order by co_code";
            m     = new MariaCRUD();
            table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbKind.DataSource    = table;
                cbKind.ValueMember   = "co_code";
                cbKind.DisplayMember = "co_item";
            }

            if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]")
            {
                this.ActiveControl = tbQty;
            }
            else
            {
                rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex;

                moveID          = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString();
                dtpDate.Value   = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString());
                tbProd.Tag      = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString();
                tbProd.Text     = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString();
                cbKind.Text     = parentWin.dataGridView1.Rows[rowIndex].Cells[8].Value.ToString();
                tbQty.Text      = parentWin.dataGridView1.Rows[rowIndex].Cells[9].Value.ToString();
                tbContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[10].Value.ToString();

                this.ActiveControl = btnSave;
            }
        }
Esempio n. 18
0
        private void pbSave_Click(object sender, EventArgs e)
        {
            lblMsg.Text = "";
            if (G.Authority == "D")
            {
                return;
            }

            if (dataGridView2.Rows.Count < 1)
            {
                lblMsg.Text = "구성품 리스트가 존재하지 않습니다.";
                return;
            }

            dataGridView2.CurrentCell = dataGridView2[0, 0];

            string    sql = string.Empty;
            string    msg = string.Empty;
            MariaCRUD m   = new MariaCRUD();

            string sProdID     = string.Empty;
            string sMaterialID = string.Empty;
            string sQty        = string.Empty;

            int iCnt = 0;

            for (int i = 0; i < dataGridView2.RowCount; i++)
            {
                sProdID     = dataGridView2.Rows[i].Cells[1].Value.ToString();
                sMaterialID = dataGridView2.Rows[i].Cells[2].Value.ToString();
                sQty        = dataGridView2.Rows[i].Cells[6].Value.ToString();

                if (string.IsNullOrEmpty(sQty))
                {
                    sQty = "0";
                }

                sql = "update tb_gi_bom set config_qty = " + sQty +
                      " where prod_id = '" + sProdID + "' and material_id = '" + sMaterialID + "'";

                m.dbCUD(sql, ref msg);
                iCnt++;
            }

            m.TransLogCreate(G.Authority, G.UserID, "M", this.Name, lblTitle.Text, sProdID + " " + iCnt.ToString() + "건");
            lblMsg.Text = "저장되었습니다.";
        }
        private void P1A01_CUSTOMER_SUB_Load(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            string    sql   = @"select saleman from tb_gi_customer where use_flag = 'O' group by saleman order by saleman";
            MariaCRUD m     = new MariaCRUD();
            string    msg   = string.Empty;
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbSaleMan.DataSource    = table;
                cbSaleMan.ValueMember   = "saleman";
                cbSaleMan.DisplayMember = "saleman";
            }

            if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]")
            {
                this.ActiveControl    = tbCustName;
                cbGubun.SelectedIndex = 0;
            }
            else
            {
                rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex;

                custCode        = parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString();
                tbCustName.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString();
                tbCeo.Text      = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString();
                cbGubun.Text    = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString();
                tbBusiNo.Text   = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString();
                cbSaleMan.Text  = parentWin.dataGridView1.Rows[rowIndex].Cells[20].Value.ToString();
                tbPostNo.Text   = parentWin.dataGridView1.Rows[rowIndex].Cells[11].Value.ToString();
                tbAddr1.Text    = parentWin.dataGridView1.Rows[rowIndex].Cells[12].Value.ToString();
                tbAddr2.Text    = parentWin.dataGridView1.Rows[rowIndex].Cells[13].Value.ToString();
                tbTel.Text      = parentWin.dataGridView1.Rows[rowIndex].Cells[15].Value.ToString();
                tbFax.Text      = parentWin.dataGridView1.Rows[rowIndex].Cells[16].Value.ToString();
                tbCustMan.Text  = parentWin.dataGridView1.Rows[rowIndex].Cells[17].Value.ToString();
                tbHp.Text       = parentWin.dataGridView1.Rows[rowIndex].Cells[18].Value.ToString();
                tbContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[21].Value.ToString();
                if (parentWin.dataGridView1.Rows[rowIndex].Cells[22].Value.ToString() == "X")
                {
                    cbFlag.Checked = true;
                }

                this.ActiveControl = btnSave;
            }
        }
        private void pbDel_Click(object sender, EventArgs e)
        {
            if (G.Authority == "D")
            {
                return;
            }

            if (dataGridView1.RowCount <= 0)
            {
                lblMsg.Text = "삭제할 검사 건이 선택되지 않았습니다.";
                return;
            }

            if (dataGridView1[8, 0].Value == null ||
                string.IsNullOrEmpty(dataGridView1[8, 0].Value.ToString()))
            {
                lblMsg.Text = "저장되지 않은 검사 건입니다.";
                return;
            }

            string sNo   = dataGridView1[8, 0].Value.ToString();
            string sCust = dataGridViewList.Rows[dataGridViewList.CurrentRow.Index].Cells[3].Value.ToString();

            DialogResult dr = MessageBox.Show("거래처명 : " + sCust + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dr == DialogResult.No)
            {
                return;
            }

            MariaCRUD m   = new MariaCRUD();
            string    sql = "delete from tb_qc_final where rorder_id = '" + sNo + "'";
            string    msg = string.Empty;

            m.dbCUD(sql, ref msg);

            if (msg != "OK")
            {
                MessageBox.Show(msg);
                return;
            }
            dataGridViewList[7, dataGridViewList.CurrentRow.Index].Value = 0;
            m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sNo + " " + sCust);

            ListInit();
            lblMsg.Text = "삭제되었습니다.";
        }
        private bool isExist(string _kind, string _no)
        {
            string sql = @"select proc_no from tb_gi_process where proc_std = '" + _kind + "' and proc_no = " + _no;

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private bool isProdName(string _gubun, string _prodName)
        {
            string sql = @"select prod_id from tb_gi_product where gubun = '" + _gubun + "' and prod_name = '" + _prodName + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 23
0
        private void lblDel_Click(object sender, EventArgs e)
        {
            try
            {
                string sNo = tbNo.Text;

                DialogResult dr = MessageBox.Show("입고번호 : " + sNo + "\r\r해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dr == DialogResult.No)
                {
                    return;
                }

                MariaCRUD m   = new MariaCRUD();
                string    sql = "update tb_purchase_mat " +
                                "set putch_flag = 0, in_date = null, in_qty = 0, amount = 0, vat = 0, depot = null, contents = null, enter_dt2 = null, enter_man2 = null" +
                                " where purch_id = '" + sNo + "'";

                string msg = string.Empty;
                m.dbCUD(sql, ref msg);

                if (msg != "OK")
                {
                    MessageBox.Show(msg);
                    return;
                }

                m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sNo + " 입고정보");

                parentWin.ListSearch();

                for (int i = 0; i < parentWin.dataGridView1.Rows.Count - 1; i++)
                {
                    if (parentWin.dataGridView1.Rows[i].Cells[0].Value.ToString() == sNo)
                    {
                        parentWin.dataGridView1.CurrentCell          = parentWin.dataGridView1[1, i];
                        parentWin.dataGridView1.CurrentCell.Selected = true;
                        break;
                    }
                }
                this.DialogResult = DialogResult.OK;
            }
            catch (InvalidOperationException)
            {
                return;
            }
        }
Esempio n. 24
0
        private void pbLogo_Click(object sender, EventArgs e)
        {
            string sql = "select homepage from tb_sys_pos where pos = '" + G.Pos + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            string    url = m.dbRonlyOne(sql, ref msg).ToString();

            if (msg == "OK" && !string.IsNullOrEmpty(url))
            {
                if (!url.Contains("http"))
                {
                    url = "http://" + url;
                }
                System.Diagnostics.Process.Start(url);
            }
        }
        private bool isCommonItem(string _kind, string _item)
        {
            string sql = @"select co_code from tb_gi_common where co_kind = '" + _kind + "' and co_item = '" + _item + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 26
0
        private bool isExist(string _pos, string _ho, string _name, string _group)
        {
            string sql = @"select machine_id from tb_machinecard where pos = '" + _pos + "' and machine_no = '" + _ho + "' and machine_name = '" + _name + "' and model_no = '" + _group + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 27
0
        private bool isPdCloseExist(string _pos, string _date, string _depot, string _prod)
        {
            string sql = @"select prod_id from tb_gi_pdclose where pos = '" + _pos + "' and close_date = '" + _date + "' and depot = '" + _depot + "' and prod_id = '" + _prod + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 28
0
        private bool isUserID(string ID)
        {
            string sql = @"select user_id from tb_sys_user where user_id = '" + ID + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private bool isCustName(string _custName)
        {
            string sql = @"select cust_id from tb_gi_customer where fullname = '" + _custName + "' or abbname = '" + _custName + "'";

            MariaCRUD m   = new MariaCRUD();
            string    msg = string.Empty;
            object    id  = m.dbRonlyOne(sql, ref msg);

            if (msg == "OK" && id != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 30
0
        private void P1A04_PROCESS_Load(object sender, EventArgs e)
        {
            string    sql   = @"select co_code, co_item from tb_gi_common where co_kind = 'D' order by co_code";
            MariaCRUD m     = new MariaCRUD();
            string    msg   = string.Empty;
            DataTable table = m.dbDataTable(sql, ref msg);

            if (msg == "OK")
            {
                cbStd.DataSource    = table;
                cbStd.ValueMember   = "co_code";
                cbStd.DisplayMember = "co_item";
                cbStd.SelectedIndex = 0;
            }

            this.ActiveControl = cbStd;
        }