private bool deletePost() { bool flag = false; try { wnDm wnDm = new wnDm(); wnAdo wnAdo = new wnAdo(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine(" delete from F_INTER_MST"); stringBuilder.AppendLine(" where 1 = 1"); stringBuilder.AppendLine(" AND M_CODE = @M_CODE"); stringBuilder.AppendLine(" AND M_NAME = @M_NAME"); stringBuilder.AppendLine(" AND INSERT_STAFF = @INSERT_STAFF"); SqlCommand sCommand = new SqlCommand(stringBuilder.ToString()); sCommand.Parameters.AddWithValue("@M_CODE", (object)this.txtCode.Text); sCommand.Parameters.AddWithValue("@M_NAME", (object)this.txtName.Text); sCommand.Parameters.AddWithValue("@INSERT_STAFF", (object)Common.p_strStaffNo); flag = wnAdo.SqlCommandEtc(sCommand, "Delete_F_INTER_MST_Table") > 0; if (!flag) { int num = (int)MessageBox.Show("삭제 중에 오류가 발생했습니다."); } } catch (Exception ex) { int num = (int)MessageBox.Show("데이터베이스에 문제가 발생했습니다."); wnLog.writeLog(100, ex.Message + " - " + ex.ToString()); } return(flag); }
public DataTable Today_Delivery() { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); //=================== 작업지시서현황 ====================== sb.AppendLine("SELECT A.DELIVERY_DATE,B.SPEC , B.ITEM_NM "); sb.AppendLine("FROM F_WORK_INST A "); sb.AppendLine("LEFT OUTER JOIN N_ITEM_CODE B ON A.ITEM_CD = B.ITEM_CD "); sb.AppendLine("WHERE A.DELIVERY_DATE = '" + today + "' "); Debug.WriteLine(sb); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
public int updateWorkState(string plan_date, string plan_cd, string state_cd) { try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb = new StringBuilder(); sb.AppendLine("update F_PLAN set"); sb.AppendLine(" STATE_CD = '" + state_cd + "' "); // RAW_OUT_YN = 'Y', sb.AppendLine("where PLAN_DATE = '" + plan_date + "' "); sb.AppendLine(" and PLAN_CD = '" + plan_cd + "' "); SqlCommand sCommand = new SqlCommand(sb.ToString()); int qResult = wAdo.SqlCommandEtc(sCommand, "update_PLAN_RAW_OUT"); if (qResult > 0) { return(0); // 0 true, 1 false } else { return(1); } } catch (Exception e) { Console.WriteLine("error" + e.ToString()); return(9); } }
//private byte[] GetImage(string path) //{ // FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read); // BinaryReader reader = new BinaryReader(stream); // byte[] image = reader.ReadBytes((int)stream.Length); // reader.Close(); // stream.Close(); // return image; //} #endregion common logic public void updateFlowChkExam(int amt) { String LLotNo = txt_lot_no.Text.ToString(); try { wnDm wDm = new wnDm(); wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine("update F_WORK_FLOW_DETAIL set POOR_AMT = " + amt + " where LOT_NO='" + LLotNo + "' and FLOW_CD='0006'"); SqlCommand sCommand = new SqlCommand(sb.ToString()); int qResult = wAdo.SqlCommandEtc(sCommand, "insert_RAW_CHK_EXAM_TB"); } catch (Exception e) { wnLog.writeLog(wnLog.LOG_ERROR, e.Message + " - " + e.ToString()); Popup.pop오류리포트 msg = new pop오류리포트(e.Message + " - " + e.ToString()); msg.ShowDialog(); return; } }
// private void 불량율bind(){ // DataTable dt불량율 = 불량율(); // // dgv불량율.DataSource = dt불량율; // for (int i = 0; i < dt불량율.Rows.Count; i++) // { // dgv불량율.Rows.Add(); // dgv불량율.Rows[i].Cells["NOW제품명"].Value = dt불량율.Rows[i]["제품명"].ToString(); // dgv불량율.Rows[i].Cells["NOW규격"].Value = dt불량율.Rows[i]["규격"].ToString(); // dgv불량율.Rows[i].Cells["NOW수량"].Value = dt불량율.Rows[i]["수량"].ToString(); // } // //panCenter.Dock = DockStyle.Fill; // //w_home1.Dock = DockStyle.Fill; //} private DataTable 불량율() { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); //sb.AppendLine("SELECT X.POOR_NM as 불량 "); //sb.AppendLine(",convert(int,ISNULL(Z.불량갯수,'0'))AS 불량갯수, "); //sb.AppendLine("CASE WHEN ISNULL(CONVERT(DECIMAL(18,2),Z.전체수),'0') = 0 THEN 0 "); //sb.AppendLine("ELSE CONVERT(DECIMAL(18,2),(ISNULL(Z.불량갯수,'0')/ ISNULL(Z.전체수,'0'))) "); //sb.AppendLine("END 불량율 FROM N_POOR_CODE X "); //sb.AppendLine(" LEFT JOIN( "); //sb.AppendLine(" select SUM(A.POOR_AMT) AS 불량갯수 ,isnull(B.POOR_NM,'알수없음') as POOR_NM ,SUM(A.F_SUB_AMT) AS 전체수 from F_WORK_FLOW_DETAIL A "); //sb.AppendLine(" FULL OUTER join N_POOR_CODE B on A.POOR_CD=B.POOR_CD"); //sb.AppendLine(" RIGHT join N_FLOW_CODE c on A.FLOW_CD=c.FLOW_CD "); //sb.AppendLine(" where A.POOR_AMT>0 "); //sb.AppendLine(" GROUP BY B.POOR_NM "); //sb.AppendLine(" )Z ON Z.POOR_NM= X.POOR_NM "); sb.AppendLine(" select ITEM_NM AS 제품명 ,MaX(item.SPEC) as 규격,MIN(CONVERT(INT,F_SUB_AMT)) as 수량 from F_WORK_FLOW_DETAIL as A "); sb.AppendLine("inner join N_ITEM_CODE as item on item.ITEM_CD=A.ITEM_CD "); sb.AppendLine(" where COMPLETE_YN='Y' and A.F_SUB_DATE=convert(varchar(10), getdate(), 120) "); sb.AppendLine(" group by ITEM_NM "); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
private DataTable 월별수량( ) { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); //==================ㅈ납기지연율== //임시테이블 셀프조인할려고 만듬 sb.AppendLine(" select ROW_NUMBER() OVER(ORDER BY substring(W_INST_DATE,0,8) ) AS ROWNUM ,substring(W_INST_DATE,0,8) as 월별 ,convert(int,SUM(INST_AMT)) as 총생산량 "); sb.AppendLine(" into #월별생산량 "); sb.AppendLine(" from F_WORK_INST as A "); sb.AppendLine(" group by substring(W_INST_DATE,0,8) "); //셀프조인하여 전로우값 을 가져옴 sb.AppendLine(" select A.월별,convert(int,isnull(a.총생산량,0)) as 올해총생산량,convert(int,isnull(prev.총생산량,0)) as 전년도총생산량 , case when isnull(prev.총생산량,0)=0 then 0 else "); sb.AppendLine(" (convert(decimal,isnull(a.총생산량,0) - isnull(prev.총생산량,0))) / isnull(prev.총생산량,0)*100 end 율 "); sb.AppendLine(" from #월별생산량 as A "); sb.AppendLine(" LEFT JOIN #월별생산량 as prev ON prev.ROWNUM = A.ROWNUM - 1"); Debug.WriteLine(sb); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
private bool updatePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" update USER_PASSWD set "); sb.AppendLine(" USER_NAME = @USER_NAME "); sb.AppendLine(" , USER_RESNUM = @USER_RESNUM "); sb.AppendLine(" , USER_PASS = @USER_PASS "); sb.AppendLine(" , USER_DEPT = @USER_DEPT "); sb.AppendLine(" , USER_MAN = @USER_MAN "); sb.AppendLine(" , USER_SELECT = @USER_SELECT "); sb.AppendLine(" , USER_SERVER1 = @USER_SERVER1 "); sb.AppendLine(" , USER_SERVER2 = @USER_SERVER2 "); sb.AppendLine(" , USER_SERVER3 = @USER_SERVER3 "); sb.AppendLine(" where 1=1 "); sb.AppendLine(" and USER_CODE = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", txtCode.Text); sCommand.Parameters.AddWithValue("@USER_NAME", txtName.Text); sCommand.Parameters.AddWithValue("@USER_RESNUM", txt주민번호.Text); sCommand.Parameters.AddWithValue("@USER_PASS", txt비밀번호.Text); sCommand.Parameters.AddWithValue("@USER_DEPT", "" + cmb부서.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@USER_MAN", "" + cmb담당자.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@USER_SELECT", "" + cmb검색조건.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@USER_SERVER1", (rb서버1.Checked == true ? "1" : "0")); sCommand.Parameters.AddWithValue("@USER_SERVER2", (rb서버2.Checked == true ? "1" : "0")); sCommand.Parameters.AddWithValue("@USER_SERVER3", "0"); int qResult = wAdo.SqlCommandEtc(sCommand, "Update USER_PASSWD"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
private bool updatePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" update DEPTCODE set "); sb.AppendLine(" CODE_DESC = @CODE_DESC "); sb.AppendLine(" , USE_CHECK = @USE_CHECK "); sb.AppendLine(" , 구분 = @구분 "); sb.AppendLine(" , 조회순서 = @조회순서 "); sb.AppendLine(" , 소계 = @소계 "); sb.AppendLine(" , 부서계 = @부서계 "); sb.AppendLine(" , AreaCode = @AreaCode "); sb.AppendLine(" where 1=1 "); sb.AppendLine(" and DEPT_CODE = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", txtCode.Text); sCommand.Parameters.AddWithValue("@CODE_DESC", txtName.Text); sCommand.Parameters.AddWithValue("@USE_CHECK", "" + cmb사용여부.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@구분", "" + cmb구분.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@조회순서", txt조회순서.Text); sCommand.Parameters.AddWithValue("@소계", txt소계.Text); sCommand.Parameters.AddWithValue("@부서계", txt부서계.Text); sCommand.Parameters.AddWithValue("@AreaCode", "" + cmb지역.SelectedValue.ToString()); int qResult = wAdo.SqlCommandEtc(sCommand, "Update_DEPTCODE_Table"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString()); msg.ShowDialog(); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
private bool updatePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" update MANCODE set "); sb.AppendLine(" CODE_DESC = @CODE_DESC "); sb.AppendLine(" , 직급 = @직급 "); sb.AppendLine(" , DEPT_CODE = @DEPT_CODE "); sb.AppendLine(" , 입사일자 = @입사일자 "); sb.AppendLine(" , MAN_OUTCHK = @MAN_OUTCHK "); sb.AppendLine(" , 퇴사일자 = @퇴사일자 "); sb.AppendLine(" where 1=1 "); sb.AppendLine(" and MAN_CODE = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", txtCode.Text); sCommand.Parameters.AddWithValue("@CODE_DESC", txtName.Text); sCommand.Parameters.AddWithValue("@직급", txt직급.Text); sCommand.Parameters.AddWithValue("@DEPT_CODE", "" + cmb부서.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@입사일자", (dtp입사일자.Text == "1900-01-01" ? "" : dtp입사일자.Text)); sCommand.Parameters.AddWithValue("@MAN_OUTCHK", (chk퇴사구분.Checked == true ? "1" : "0")); sCommand.Parameters.AddWithValue("@퇴사일자", (dtp퇴사일자.Text == "1900-01-01" ? "" : dtp퇴사일자.Text)); int qResult = wAdo.SqlCommandEtc(sCommand, "Update MANCODE"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
public int deletePlan(string plan_date, string plan_cd, string jumun_date, string jumun_cd, string jumun_seq) { try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine("delete from F_PLAN "); sb.AppendLine(" where PLAN_DATE = @PLAN_DATE "); sb.AppendLine(" and PLAN_CD = @PLAN_CD "); sb.AppendLine("delete from F_PLAN_RAW "); sb.AppendLine(" where PLAN_DATE = @PLAN_DATE "); sb.AppendLine(" and PLAN_CD = @PLAN_CD "); sb.AppendLine("delete from F_PLAN_FAC "); sb.AppendLine(" where PLAN_DATE = @PLAN_DATE "); sb.AppendLine(" and PLAN_CD = @PLAN_CD "); sb.AppendLine("delete from F_PLAN_SUBJECT "); sb.AppendLine(" where PLAN_DATE = @PLAN_DATE "); sb.AppendLine(" and PLAN_CD = @PLAN_CD "); sb.AppendLine("update F_JUMUN_DETAIL "); sb.AppendLine(" set PLAN_YN = 'N' "); sb.AppendLine(" where JUMUN_DATE = @JUMUN_DATE "); sb.AppendLine(" and JUMUN_CD = @JUMUN_CD "); sb.AppendLine(" and SEQ = @JUMUN_SEQ "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@PLAN_DATE", plan_date); sCommand.Parameters.AddWithValue("@PLAN_CD", plan_cd); sCommand.Parameters.AddWithValue("@JUMUN_DATE", jumun_date); sCommand.Parameters.AddWithValue("@JUMUN_CD", jumun_cd); sCommand.Parameters.AddWithValue("@JUMUN_SEQ", jumun_seq); int qResult = wAdo.SqlCommandEtc(sCommand, "delete_PLAN_TB"); if (qResult > 0) { return(0); // 0 true, 1 false } else { return(1); } } catch (Exception e) { wnLog.writeLog(wnLog.LOG_ERROR, e.Message + " - " + e.ToString()); return(9); } }
public int deleteWork(string txt_work_date, string lbl_work_cd) { try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine("delete from F_WORK_RESULT "); sb.AppendLine(" where WORK_DATE = @WORK_DATE "); sb.AppendLine(" and WORK_CD = @WORK_CD "); sb.AppendLine("delete from F_WORK_RESULT_FLOW "); sb.AppendLine(" where WORK_DATE = @WORK_DATE "); sb.AppendLine(" and WORK_CD = @WORK_CD "); sb.AppendLine("delete from F_WORK_RESULT_RAW "); sb.AppendLine(" where WORK_DATE = @WORK_DATE "); sb.AppendLine(" and WORK_CD = @WORK_CD "); //sb.AppendLine("update F_PLAN "); //sb.AppendLine(" set ORDER_YN = 'N' "); //sb.AppendLine(" where JUMUN_DATE = @JUMUN_DATE "); //sb.AppendLine(" and JUMUN_CD = @JUMUN_CD "); //sb.AppendLine(" and SEQ = @JUMUN_SEQ "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@WORK_DATE", txt_work_date); sCommand.Parameters.AddWithValue("@WORK_CD", lbl_work_cd); //sCommand.Parameters.AddWithValue("@JUMUN_DATE", w_jumun_date); //sCommand.Parameters.AddWithValue("@JUMUN_CD", w_jumun_cd); //sCommand.Parameters.AddWithValue("@JUMUN_SEQ", w_jumun_seq); int qResult = wAdo.SqlCommandEtc(sCommand, "delete_PLAN_TB"); if (qResult > 0) { return(0); // 0 true, 1 false } else { return(1); } } catch (Exception e) { wnLog.writeLog(wnLog.LOG_ERROR, e.Message + " - " + e.ToString()); return(9); } }
private bool updatePost() { if (!this.validate_InputBox()) { return(false); } bool flag = false; try { wnAdo wnAdo = new wnAdo(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine(" UPDATE F_INTER_MST "); stringBuilder.AppendLine("SET M_CODE = @M_CODE"); stringBuilder.AppendLine(", M_NAME = @M_NAME"); stringBuilder.AppendLine(", STD_TEMP = @STD_TEMP"); stringBuilder.AppendLine(", STD_HUM = @STD_HUM"); stringBuilder.AppendLine(", ERROR_TEMP = @ERROR_TEMP"); stringBuilder.AppendLine(", ERROR_HUM = @ERROR_HUM"); stringBuilder.AppendLine(", MEMO = @MEMO"); stringBuilder.AppendLine(", UPDATE_STAFF = @UPDATE_STAFF"); stringBuilder.AppendLine(", UPDATE_DATE = getDate()"); stringBuilder.AppendLine(" WHERE 1 = 1"); stringBuilder.AppendLine(" AND M_CODE = @OLD_M_CODE"); SqlCommand sCommand = new SqlCommand(stringBuilder.ToString()); sCommand.Parameters.AddWithValue("@M_CODE", this.txtCode.Text); sCommand.Parameters.AddWithValue("@M_NAME", this.txtName.Text); sCommand.Parameters.AddWithValue("@STD_TEMP", this.txtStdTemp.Text); sCommand.Parameters.AddWithValue("@STD_HUM", this.txtStdHum.Text); sCommand.Parameters.AddWithValue("@ERROR_TEMP", this.txtErrTemp.Text); sCommand.Parameters.AddWithValue("@ERROR_HUM", this.txtErrHum.Text); sCommand.Parameters.AddWithValue("@MEMO", this.txtMemo.Text); sCommand.Parameters.AddWithValue("@UPDATE_STAFF", (object)Common.p_strStaffNo); sCommand.Parameters.AddWithValue("@OLD_M_CODE", this.txtOldCode.Text); flag = wnAdo.SqlCommandEtc(sCommand, "Save_F_INTER_MST_Table") > 0; if (!flag) { int num = (int)MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(100, ex.Message + " - " + ex.ToString()); int num = (int)MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(flag); }
private bool deletePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" delete from T_GroupUser "); sb.AppendLine(" where GrpID = @p1 "); sb.AppendLine(" delete from T_GroupSub "); sb.AppendLine(" where GrpID = @p1 "); sb.AppendLine(" delete from T_GroupTop "); sb.AppendLine(" where GrpID = @p1 "); sb.AppendLine(" delete from T_Group "); sb.AppendLine(" where GrpID = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", this.txtCode.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Delete Group"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("삭제 중에 오류가 발생했습니다."); } } catch (Exception ex) { MessageBox.Show("데이터베이스에 문제가 발생했습니다."); wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); } return(bRet); }
private bool insertPost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" insert into PRODUCTKIND ( "); sb.AppendLine(" PRODUCT_KIND "); sb.AppendLine(" , CODE_DESC "); sb.AppendLine(" ) values ( "); sb.AppendLine(" @PRODUCT_KIND "); sb.AppendLine(" , @CODE_DESC "); sb.AppendLine(" ) "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@PRODUCT_KIND", txtCode.Text); sCommand.Parameters.AddWithValue("@CODE_DESC", txtName.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Insert PRODUCTKIND"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
private bool deletePost() { bool bRet = false; try { wnDm wDm = new wnDm(); wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" delete from PRODUCT_COLLECT "); sb.AppendLine(" where COLLECT_DATE = @COLLECT_DATE "); sb.AppendLine(" and COLLECT_NUM = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@COLLECT_DATE", dtp일자.Text); sCommand.Parameters.AddWithValue("@p1", lbl번호.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Delete-PRODUCT_COLLECT"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("삭제 중에 오류가 발생했습니다."); } } catch (Exception ex) { MessageBox.Show("데이터베이스에 문제가 발생했습니다."); wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString()); msg.ShowDialog(); } return(bRet); }
private bool deletePost() { bool bRet = false; try { wnDm wDm = new wnDm(); wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" delete from PRODUCT_STOCK_DEPT "); sb.AppendLine(" where STOCK_DATE = @STOCK_DATE "); sb.AppendLine(" and STOCK_NUM = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@STOCK_DATE", this.dtp일자.Text); sCommand.Parameters.AddWithValue("@p1", this.lbl번호.Text); ////sCommand.Parameters.AddWithValue("@수정사원번호", Common.p_strUserNo); int qResult = wAdo.SqlCommandEtc(sCommand, "Delete-PRODUCT_STOCK_DEPT"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("삭제 중에 오류가 발생했습니다."); } } catch (Exception ex) { MessageBox.Show("데이터베이스에 문제가 발생했습니다."); wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); } return(bRet); }
private bool deletePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" delete from STOCK_GOAL "); sb.AppendLine(" where 1=1 "); sb.AppendLine(" and GOAL_YEAR = @p1 "); sb.AppendLine(" and GOAL_CODE = @p2 "); sb.AppendLine(" and MAN_CODE = @p3 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", "" + cmb연도.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@p2", "" + cmb구분.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@p3", txt담당자코드old.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Delete STOCK_GOAL"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("삭제 중에 오류가 발생했습니다."); } } catch (Exception ex) { MessageBox.Show("데이터베이스에 문제가 발생했습니다."); wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); } return(bRet); }
private bool savePost(string sCust, string sCustName) { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" exec dbo.proc_할인마감 @Day1, @Day2, @SDay, @CustCode, @UserCode "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@Day1", dtp마감일자1.Text); sCommand.Parameters.AddWithValue("@Day2", dtp마감일자2.Text); sCommand.Parameters.AddWithValue("@SDay", dtp수금일자.Text); sCommand.Parameters.AddWithValue("@CustCode", sCust); sCommand.Parameters.AddWithValue("@UserCode", Common.p_strUserCode); int qResult = wAdo.SqlCommandEtc(sCommand, "MaGam PRODUCT_STOCK to PRODUCT_COLLECT"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("거래처 [ " + sCustName + " ]의 할인마감 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
private bool updatePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" update MAJORCODE set "); sb.AppendLine(" CODE_DESC = @CODE_DESC "); sb.AppendLine(" where 1=1 "); sb.AppendLine(" and MAJOR_CODE = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", txtCode.Text); sCommand.Parameters.AddWithValue("@CODE_DESC", txtName.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Update MAJORCODE"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString()); msg.ShowDialog(); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
public int updateOutSignYn(string out_date, string out_cd, string up_prog_cd) { try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb = new StringBuilder(); sb.AppendLine("update F_ITEM_OUT set"); sb.AppendLine(" PROG_CD = '" + up_prog_cd + "' "); // RAW_OUT_YN = 'Y', if (up_prog_cd.ToString().Equals("2")) { sb.AppendLine(" ,OUT_SIGN_YN = 'Y' "); } else if (up_prog_cd.ToString().Equals("3")) { sb.AppendLine(" ,QUAL_SIGN_YN = 'Y' "); } else { sb.AppendLine(" ,ST_MG_SIGN_YN = 'Y' "); } sb.AppendLine("where OUT_DATE = '" + out_date + "' "); sb.AppendLine(" and OUT_CD = '" + out_cd + "' "); SqlCommand sCommand = new SqlCommand(sb.ToString()); int qResult = wAdo.SqlCommandEtc(sCommand, "update_PLAN_RAW_OUT"); if (qResult > 0) { return(0); // 0 true, 1 false } else { return(1); } } catch (Exception e) { Console.WriteLine("error" + e.ToString()); return(9); } }
private DataTable allMenu() { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" select A.TopID, A.SubID,A.AsmName,A.SubName from T_SubMenu as A "); sb.AppendLine(" where A.VIEW_YN = 'Y' "); sb.AppendLine(" order by SortNo "); Debug.WriteLine(sb); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
private bool deletePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" delete from USER_PASSWD "); sb.AppendLine(" where USER_CODE = @p1 "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@p1", this.txtCode.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Delete USER_PASSWD"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("삭제 중에 오류가 발생했습니다."); } } catch (Exception ex) { MessageBox.Show("데이터베이스에 문제가 발생했습니다."); wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString()); msg.ShowDialog(); } return(bRet); }
public DataTable Today_Notice() { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine("SELECT top 20 SEQ, TITLE, CONTENT, INSTAFF ,substring(intime,0,11) as intime2,intime "); sb.AppendLine("FROM N_NOTICE "); sb.AppendLine(" order by intime DESC "); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
private DataTable bookmark() { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" select A.TopID,A.SubID,B.AsmName,B.SubName from N_AUTH_SUB as A "); sb.AppendLine("inner join T_SubMenu as B on A.TopID=B.TopID and A.SubID=B.SubID "); sb.AppendLine("where STAFF_CD='" + Common.p_strStaffNo + "'and A.bookmark='Y'"); sb.AppendLine(" order by SortNo"); Debug.WriteLine(sb); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
private bool updatePost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" exec dbo.proc_영업소주문서결재처리 @STOCK_DATE, @STOCK_NUM "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@STOCK_DATE", dtp일자.Text); sCommand.Parameters.AddWithValue("@STOCK_NUM", lbl번호.Text); int qResult = wAdo.SqlCommandEtc(sCommand, "Move-PRODUCT_STOCK_DEPT"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }
public void insert(String date, String title, String memo) { try { wnDm wDm = new wnDm(); wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" insert into F_DATES (Title,date,Memo,color) values ('" + title + "','" + date + "','" + memo + "','" + scolor16 + "')"); SqlCommand sCommand = new SqlCommand(sb.ToString()); int qResult = wAdo.SqlCommandEtc(sCommand, "insert_RAW_CHK_EXAM_TB"); } catch (Exception e) { wnLog.writeLog(wnLog.LOG_ERROR, e.Message + " - " + e.ToString()); Popup.pop오류리포트 msg = new pop오류리포트(e.Message + " - " + e.ToString()); msg.ShowDialog(); return; } }
private void clear() { try { wnDm wDm = new wnDm(); wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" delete from F_DATES where Date='" + dtp.Value.ToString().Substring(0, 10) + "' "); SqlCommand sCommand = new SqlCommand(sb.ToString()); int qResult = wAdo.SqlCommandEtc(sCommand, "insert_RAW_CHK_EXAM_TB"); } catch (Exception e) { wnLog.writeLog(wnLog.LOG_ERROR, e.Message + " - " + e.ToString()); Popup.pop오류리포트 msg = new pop오류리포트(e.Message + " - " + e.ToString()); msg.ShowDialog(); return; } }
private DataTable 일정관리() { //select title,date from F_DATES wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine("select title,date,isnull(color,'#000000') as color from F_DATES "); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
public DataTable notice2(String condition) { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine("select A.TITLE,A.CONTENT,A.INTIME,B.STAFF_NM from n_notice as A "); sb.AppendLine("inner join N_STAFF_CODE as B on A.INSTAFF=B.STAFF_CD"); sb.AppendLine("where INTIME like '%" + condition + "%' "); Debug.WriteLine(sb); SqlCommand sCommand = new SqlCommand(sb.ToString()); if (sCommand.CommandText.Equals(null)) { wnLog.writeLog(wnLog.LOG_ERROR, wnLog.LOGSTRING_NO_QUERY); return(null); } return(wAdo.SqlCommandSelect(sCommand)); }
private bool insertPost() { bool bRet = false; try { wnAdo wAdo = new wnAdo(); StringBuilder sb = new StringBuilder(); sb.AppendLine(" select isnull(max(convert(int, MAN_CODE)), " + cmb부서지역.SelectedValue.ToString() + "000) + 1 "); sb.AppendLine(" from MANCODE where MAN_CODE like '" + cmb부서지역.SelectedValue.ToString() + "%' "); string sRetVal = wConst.maxValue_Check(sb.ToString()); if (sRetVal == "") { MessageBox.Show("데이터 검색 중 오류 발생!!!"); return(false); } if (int.Parse("" + cmb부서지역.SelectedValue.ToString() + "999") < int.Parse(sRetVal)) { MessageBox.Show("부서별로 규정된 범위를 초과하는 [ 코드 ]입니다." + " [ " + sRetVal + " ]"); return(false); } sb = new StringBuilder(); sb.AppendLine(" insert into MANCODE ( "); sb.AppendLine(" MAN_CODE "); sb.AppendLine(" , CODE_DESC "); sb.AppendLine(" , 직급 "); sb.AppendLine(" , DEPT_CODE "); sb.AppendLine(" , 입사일자 "); sb.AppendLine(" , MAN_OUTCHK "); sb.AppendLine(" , 퇴사일자 "); sb.AppendLine(" ) values ( "); sb.AppendLine(" @MAN_CODE "); sb.AppendLine(" , @CODE_DESC "); sb.AppendLine(" , @직급 "); sb.AppendLine(" , @DEPT_CODE "); sb.AppendLine(" , @입사일자 "); sb.AppendLine(" , @MAN_OUTCHK "); sb.AppendLine(" , @퇴사일자 "); sb.AppendLine(" ) "); SqlCommand sCommand = new SqlCommand(sb.ToString()); sCommand.Parameters.AddWithValue("@MAN_CODE", sRetVal); sCommand.Parameters.AddWithValue("@CODE_DESC", txtName.Text); sCommand.Parameters.AddWithValue("@직급", txt직급.Text); sCommand.Parameters.AddWithValue("@DEPT_CODE", "" + cmb부서.SelectedValue.ToString()); sCommand.Parameters.AddWithValue("@입사일자", (dtp입사일자.Text == "1900-01-01" ? "" : dtp입사일자.Text)); sCommand.Parameters.AddWithValue("@MAN_OUTCHK", (chk퇴사구분.Checked == true ? "1" : "0")); sCommand.Parameters.AddWithValue("@퇴사일자", (dtp퇴사일자.Text == "1900-01-01" ? "" : dtp퇴사일자.Text)); int qResult = wAdo.SqlCommandEtc(sCommand, "Insert MANCODE"); if (qResult > 0) { bRet = true; } else { bRet = false; } if (bRet == true) { } else { MessageBox.Show("저장 중에 오류가 발생했습니다."); } } catch (Exception ex) { wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); MessageBox.Show("데이터베이스에 문제가 발생했습니다."); } return(bRet); }