Ejemplo n.º 1
0
        public void userUpdate()
        {
            if (checkNull() != 1)
            {
                getData.Add("ID", "" + txt_UserId.Text);
                getData.Add("USER_NAME", "" + txt_UserName.Text);
                getData.Add("USER_PASSWORD", Bm_Main.setPw(txt_Password.Text));
                getData.Add("USER_TYPE", getUserType(userTypeComboBox.Text));

                string rCheck = req.update("BMS004", qm.getQuery("Sys_002_U", getData), "BMI");

                if (rCheck.Equals("0"))
                {
                    MessageBox.Show("사용자가 정상적으로 변경되었습니다");

                    rCheck = req.update("BMS004", qm.getQuery("SYS002_LOG_M", "1", getData["ID"]), "BMI");


                    UserGridView.Rows.Clear();
                    showData();



                    getData.Clear();
                    Log.WriteLog("rowNum : " + rowNum);
                }
                else
                {
                    MessageBox.Show("사용자 정보 변경 실패");
                    rCheck = req.update("BMS004", qm.getQuery("SYS002_LOG_M", "0", getData["ID"]), "BMI");
                }
                queryType = "S";
            }
        }
Ejemplo n.º 2
0
        public void userInsert()
        {
            if (checkNull() != 1)
            {
                getData.Add("ID", "" + txt_UserId.Text);
                getData.Add("USER_NAME", "" + txt_UserName.Text);
                getData.Add("USER_PASSWORD", Bm_Main.setPw(txt_Password.Text));
                getData.Add("CREATE_ID", Bm_Login.login_Id);
                getData.Add("USER_TYPE", getUserType(userTypeComboBox.Text));
                Cursor.Current = Cursors.WaitCursor;
                string rCheck = req.update("BMS004", qm.getQuery("Sys_002_I", getData), "BMI");

                if (rCheck.Equals("0"))
                {
                    MessageBox.Show("사용자가 정상적으로 추가되었습니다");

                    rCheck = req.update("BMS004", qm.getQuery("SYS002_LOG_N", "1", getData["ID"]), "BMI");

                    UserGridView.Rows.Clear();
                    showData();
                    getData.Clear();
                    Log.WriteLog("rowNum : " + rowNum);
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    MessageBox.Show("사용자 추가 실패");
                    rCheck = req.update("BMS004", qm.getQuery("SYS002_LOG_N", "0", getData["ID"]), "BMI");
                }
                queryType = "S";
            }
        }
Ejemplo n.º 3
0
        public void updatePassword()
        {
            string rCheck = req.update("BMS009", qm.getQuery("Sys_007_U", Bm_Login.login_Id, Bm_Main.setPw(txtNewPassword.Text)), "BMI");


            if (rCheck.Equals("0"))
            {
                MessageBox.Show("패스워드가 정상적으로 변경되었습니다");
                rCheck = req.update("BMS009", qm.getQuery("SYS007_LOG_M", "1"), "BMI");
                if (!rCheck.Equals("0"))
                {
                    MessageBox.Show("로그 저장 실패..");
                }
            }
            else
            {
                MessageBox.Show("패스워드 변경 실패");
            }
        }
Ejemplo n.º 4
0
        public void cellValueChange(object sender, DataGridViewCellEventArgs e)
        {
            if (!updateFlag)
            {
                return;
            }

            if (queryType.Equals("I"))
            {
                return;
            }
            queryType = "U";
            string checkServerNum = "" + dataGridView1.Rows[e.RowIndex].Cells[0].Value;

            DataRow row = null;

            row = updateDataTable.Select("ACSID = " + dataGridView1.Rows[e.RowIndex].Cells[0].Value).FirstOrDefault();

            if (row == null) //수정한 데이터값이 DataTable에 없을때 추가
            {
                row                = updateDataTable.NewRow();
                row["ACSID"]       = "" + dataGridView1.Rows[e.RowIndex].Cells[0].Value;
                row["SERVER_NAME"] = "" + dataGridView1.Rows[e.RowIndex].Cells[1].Value;
                int serverType = getServerType(e.RowIndex);
                row["SERVER_TYPE"] = "" + serverType;
                row["P_IP"]        = "" + dataGridView1.Rows[e.RowIndex].Cells[3].Value;
                row["S_IP"]        = "" + dataGridView1.Rows[e.RowIndex].Cells[4].Value;
                row["SERVER_ID"]   = "" + dataGridView1.Rows[e.RowIndex].Cells[5].Value;
                if (dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString().Length != 24)
                {// 패스워드를 수정했는지 체크 암호화 암호화된 문자의 길이는 24
                    row["SERVER_PW"] = Bm_Main.setPw("" + dataGridView1.Rows[e.RowIndex].Cells[6].Value);
                }
                else
                {
                    row["SERVER_PW"] = "" + dataGridView1.Rows[e.RowIndex].Cells[6].Value;
                }

                row["DB_NAME"] = "" + dataGridView1.Rows[e.RowIndex].Cells[7].Value;
                row["DB_ID"]   = "" + dataGridView1.Rows[e.RowIndex].Cells[8].Value;
                if (dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString().Length != 24)
                {// 패스워드를 수정했는지 체크 암호화 암호화된 문자의 길이는 24
                    row["DB_PW"] = Bm_Main.setPw("" + dataGridView1.Rows[e.RowIndex].Cells[9].Value);
                }
                else
                {
                    row["DB_PW"] = "" + dataGridView1.Rows[e.RowIndex].Cells[9].Value;
                }
                row["DB_HOST"]            = "" + dataGridView1.Rows[e.RowIndex].Cells[10].Value;
                row["DB_HOST2"]           = "" + dataGridView1.Rows[e.RowIndex].Cells[11].Value;
                row["DB_SERVICE"]         = "" + dataGridView1.Rows[e.RowIndex].Cells[12].Value;
                row["CURRENT_SERVER_NUM"] = checkServerNum;
                updateDataTable.Rows.Add(row);

                for (int i = 0; i < updateDataTable.Rows.Count; i++)
                {
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][0]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][1]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][2]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][3]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][4]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][5]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][6]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][7]);
                }

                Log.WriteLog("updateDataTable.Rows.Count : " + updateDataTable.Rows.Count);
            }
            else  //수정한 데이터값이 DataTable에 있으면 값수정
            {
                row["ACSID"]       = "" + dataGridView1.Rows[e.RowIndex].Cells[0].Value;
                row["SERVER_NAME"] = "" + dataGridView1.Rows[e.RowIndex].Cells[1].Value;
                int serverType = getServerType(e.RowIndex);
                row["SERVER_TYPE"] = "" + serverType;
                row["P_IP"]        = "" + dataGridView1.Rows[e.RowIndex].Cells[3].Value;
                row["S_IP"]        = "" + dataGridView1.Rows[e.RowIndex].Cells[4].Value;
                row["SERVER_ID"]   = "" + dataGridView1.Rows[e.RowIndex].Cells[5].Value;

                if (dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString().Length != 24)
                {
                    row["SERVER_PW"] = Bm_Main.setPw("" + dataGridView1.Rows[e.RowIndex].Cells[6].Value);
                }
                else
                {
                    row["SERVER_PW"] = "" + dataGridView1.Rows[e.RowIndex].Cells[6].Value;
                }
                row["DB_NAME"] = "" + dataGridView1.Rows[e.RowIndex].Cells[7].Value;
                row["DB_ID"]   = "" + dataGridView1.Rows[e.RowIndex].Cells[8].Value;
                if (dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString().Length != 24)
                {
                    row["DB_PW"] = Bm_Main.setPw("" + dataGridView1.Rows[e.RowIndex].Cells[9].Value);
                }
                else
                {
                    row["DB_PW"] = "" + dataGridView1.Rows[e.RowIndex].Cells[9].Value;
                }
                row["DB_HOST"]    = "" + dataGridView1.Rows[e.RowIndex].Cells[10].Value;
                row["DB_HOST2"]   = "" + dataGridView1.Rows[e.RowIndex].Cells[11].Value;
                row["DB_SERVICE"] = "" + dataGridView1.Rows[e.RowIndex].Cells[12].Value;

                for (int i = 0; i < updateDataTable.Rows.Count; i++)
                {
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][0]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][1]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][2]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][3]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][4]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][5]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][6]);
                    Log.WriteLog("updateDataTable : " + i + " : " + updateDataTable.Rows[i][7]);
                }

                Log.WriteLog("updateDataTable.Rows.Count : " + updateDataTable.Rows.Count);
            }
        }
Ejemplo n.º 5
0
        public void insertData()
        {
            int serverType = 1;

            if (dataGridView1.Rows[rowNum].Cells[0].Value.Equals(""))
            {
                MessageBox.Show("ACSID값은 반드시 입력해야합니다.");
                dataGridView1.Rows.RemoveAt(rowNum);
                queryType = "S";
                return;
            }

            if (dataGridView1.Rows[rowNum].Cells[1].Value.Equals(""))
            {
                MessageBox.Show("서버명은 반드시 입력해야합니다.");
                dataGridView1.Rows.RemoveAt(rowNum);
                queryType = "S";
                return;
            }

            if (dataGridView1.Rows[rowNum].Cells[2].Value.Equals(""))
            {
                MessageBox.Show("메인 IP는 반드시 입력해야합니다.");
                dataGridView1.Rows.RemoveAt(rowNum);
                queryType = "S";
                return;
            }

            if (dataGridView1.Rows[rowNum].Cells[6].Value.Equals(""))
            {
                MessageBox.Show("DB명은 반드시 입력해야합니다.");
                dataGridView1.Rows.RemoveAt(rowNum);
                queryType = "S";
                return;
            }

            if (dataGridView1.Rows[rowNum].Cells[7].Value.Equals(""))
            {
                MessageBox.Show("DB ID는 반드시 입력해야합니다.");
                dataGridView1.Rows.RemoveAt(rowNum);
                queryType = "S";
                return;
            }

            if (dataGridView1.Rows[rowNum].Cells[8].Value.Equals(""))
            {
                MessageBox.Show("DB 패스워드는 반드시 입력해야 합니다.");
                dataGridView1.Rows.RemoveAt(rowNum);
                queryType = "S";
                return;
            }

            string result = resultcheckDuplicationServerNum();

            if (result.Equals("O"))
            {
                MessageBox.Show("ACS ID값은 중복으로 입력할수없습니다");
                return;
            }



            getData.Add("ACSID", "" + this.dataGridView1.Rows[rowNum].Cells[0].Value);
            getData.Add("SERVER_NAME", "" + this.dataGridView1.Rows[rowNum].Cells[1].Value);
            serverType = getServerType(rowNum);
            getData.Add("SERVER_TYPE", "" + serverType);
            getData.Add("MAIN_IP", "" + this.dataGridView1.Rows[rowNum].Cells[3].Value);
            getData.Add("SUB_IP", "" + this.dataGridView1.Rows[rowNum].Cells[4].Value);
            getData.Add("SERVER_ID", "" + this.dataGridView1.Rows[rowNum].Cells[5].Value);
            getData.Add("SERVER_PASSWORD", Bm_Main.setPw("" + this.dataGridView1.Rows[rowNum].Cells[6].Value));
            getData.Add("DB_NAME", "" + this.dataGridView1.Rows[rowNum].Cells[7].Value);
            getData.Add("DB_ID", "" + this.dataGridView1.Rows[rowNum].Cells[8].Value);
            getData.Add("DB_PASSWORD", Bm_Main.setPw("" + this.dataGridView1.Rows[rowNum].Cells[9].Value));
            getData.Add("DB_HOST", "" + this.dataGridView1.Rows[rowNum].Cells[10].Value);
            getData.Add("DB_HOST2", "" + this.dataGridView1.Rows[rowNum].Cells[11].Value);
            getData.Add("DB_SERVICE", "" + this.dataGridView1.Rows[rowNum].Cells[12].Value);


            Log.WriteLog("ACS ID = " + getData["ACSID"]);
            Log.WriteLog("SRVER_NAME = " + getData["SERVER_NAME"]);
            Log.WriteLog("SERVER_TYPE= " + getData["SERVER_TYPE"]);
            Log.WriteLog("MAIN_IP = " + getData["MAIN_IP"]);
            Log.WriteLog("SUB_IP = " + getData["SUB_IP"]);
            Log.WriteLog("SERVER_ID = " + getData["SERVER_ID"]);
            Log.WriteLog("SERVER_PASSWORD= "******"SERVER_PASSWORD"]);
            Log.WriteLog("DB_NAME = " + getData["DB_NAME"]);
            Log.WriteLog("DB_ID = " + getData["DB_ID"]);
            Log.WriteLog("DB_PASSWORD = "******"DB_PASSWORD"]);
            Log.WriteLog("DB_HOST = " + getData["ACSID"]);
            Log.WriteLog("DB_SERVICE = " + getData["DB_SERVICE"]);

            string rCheck = req.update("BMS003", qm.getQuery("Sys_001_I", getData) + "^" + qm.getQuery("Sys_001_N_LOG", getData), "BMI");


            if (rCheck.Equals("0"))
            {
                MessageBox.Show("ACS정보가 정상적으로 반영되었습니다");



                dataGridView1.Rows.Clear();
                showData();

                rowNum = dt.Rows.Count;
                Log.WriteLog("rowNum : " + rowNum);
            }
            else
            {
                MessageBox.Show("ACS정보 변경 실패");
            }
            getData.Clear();
            queryType = "S";
        }