private void ViewLink(object sender, EventArgs e) { if (LstLink.SelectedItems.Count == 1) { int row = LstLink.SelectedIndex; FileGet get = new FileGet(_dtLink.Rows[row]["LINK"].ToString()); get.Close(); } }
//문서 수정 private void DocumentControl(object sender, DataGridViewCellEventArgs e) { DataGridView view = (DataGridView)sender; if (e.RowIndex > -1) { if ("FILE_DESC".Equals(view.Columns[e.ColumnIndex].Name)) { FileGet get = new FileGet(view.Rows[e.RowIndex].Cells["LINK_DESC"].Value.ToString()); get.Close(); } else if ("CREATE".Equals(view.Columns[e.ColumnIndex].Name)) { OpenFileDialog frm = new OpenFileDialog(); if (frm.ShowDialog() == DialogResult.OK) { string desc = Microsoft.VisualBasic.Interaction.InputBox("File 변경사항을 입력하시오.", "문서 등록"); new FileSender(view.Rows[e.RowIndex].Cells["LINK_CD"].Value.ToString(), frm.FileName + "*" + view.Rows[e.RowIndex].Cells["FILE_DESC"].Value.ToString()); ClearSearchData(); SetSearchData("LINK_CODE", view.Rows[e.RowIndex].Cells["LINK_CD"].Value.ToString()); SetSearchData("CRT_USER_ID", DTOFactory.UserId); SetSearchData("DESC", desc); SetSearchData("SEQ_NO", (float.Parse(view.Rows[e.RowIndex].Cells["REV_NO"].Value.ToString()) + 0.1).ToString()); SetSearchData("GRP_NO", gd_schedule.SelectedCells.Count > 0 ? gd_schedule.Rows[gd_schedule.SelectedCells[0].RowIndex].Cells["SCH_DESC"].Value : "사업 접수"); SetServiceId("InsertBusinessDocument"); try { DTOFactory.Transaction(new ReportDTO()); ViewMessage.Info("문서 등록이 완료 되었습니다."); gd_Document.DataSource = DTOFactory.GetDataTable(); } catch (Exception ex) { ViewMessage.Error(ex.Message); } } } } }
private void ViewLink(object sender, EventArgs e) { Button btn = (Button)sender; string link = ""; if ("btnPlanView".Equals(btn.Name)) { link = _dtPlan.Rows[LstPlan.SelectedIndex]["LINK"].ToString(); } else if ("btnEstimateView".Equals(btn.Name)) { link = _dtEstimate.Rows[LstEstimate.SelectedIndex]["LINK"].ToString(); } else if ("btnDocumentView".Equals(btn.Name)) { link = _dtDocument.Rows[LstDocument.SelectedIndex]["LINK"].ToString(); } FileGet get = new FileGet(link); get.Close(); }
private void SetCompInfo(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1 && e.ColumnIndex > -1) { DataGridView view = (DataGridView)sender; DataRow row = _dtComp.Rows[e.RowIndex]; if ("FILE1".Equals(view.Columns[e.ColumnIndex].Name)) { if (!"".Equals(row["FILE_1"].ToString())) { FileGet file = new FileGet(row["FILE_1"].ToString()); file.Close(); } } else if ("FILE2".Equals(view.Columns[e.ColumnIndex].Name)) { if (!"".Equals(row["FILE_2"].ToString())) { FileGet file = new FileGet(row["FILE_2"].ToString()); file.Close(); } } else if ("FILE3".Equals(view.Columns[e.ColumnIndex].Name)) { if (!"".Equals(row["FILE_3"].ToString())) { FileGet file = new FileGet(row["FILE_3"].ToString()); file.Close(); } } else if ("FILE4".Equals(view.Columns[e.ColumnIndex].Name)) { if (!"".Equals(row["FILE_4"].ToString())) { FileGet file = new FileGet(row["FILE_4"].ToString()); file.Close(); } } else if ("MODIFY".Equals(view.Columns[e.ColumnIndex].Name)) { var frm = new Popup.FrmInsertVendorComp() { CompName = row["COMP_NM"].ToString(), SiteName = row["SITE_NM"].ToString(), UserName = row["USER_NM"].ToString(), Grade = row["GRADE_NM"].ToString(), AddrCode = row["ADDR_CD"].ToString(), Addr = row["ADDR"].ToString(), Tel = row["TEL"].ToString(), Fax = row["FAX"].ToString(), Mail = row["EMAIL"].ToString(), HomePage = row["WEB"].ToString(), Regid = row["REG_ID"].ToString(), BankCode = row["BNK_CD"].ToString(), BankNo = row["BNK_NO"].ToString() }; if (frm.ShowDialog() == DialogResult.OK) { string LINK = row["LINK_CD"].ToString(); if (!"".Equals(frm.FILE1)) { if (!"".Equals(row["FILE_1"].ToString())) { FileSender del1 = new FileSender(LINK, row["FILE_1"].ToString(), false, 'M'); del1.Close(); } FileSender file1 = new FileSender(LINK, frm.FILE1, true, 'M', 1); LINK = file1.GetLinkCode(); file1.Close(); } if (!"".Equals(frm.FILE2)) { if (!"".Equals(row["FILE_2"].ToString())) { FileSender del2 = new FileSender(LINK, row["FILE_2"].ToString(), false, 'M'); del2.Close(); } FileSender file2 = new FileSender(LINK, frm.FILE2, true, 'M', 2); LINK = file2.GetLinkCode(); file2.Close(); } if (!"".Equals(frm.FILE3)) { if (!"".Equals(row["FILE_3"].ToString())) { FileSender del3 = new FileSender(LINK, row["FILE_3"].ToString(), false, 'M'); del3.Close(); } FileSender file3 = new FileSender(LINK, frm.FILE3, true, 'M', 3); LINK = file3.GetLinkCode(); file3.Close(); } if (!"".Equals(frm.FILE4)) { if (!"".Equals(row["FILE_4"].ToString())) { FileSender del4 = new FileSender(LINK, row["FILE_4"].ToString(), false, 'M'); del4.Close(); } FileSender file4 = new FileSender(LINK, frm.FILE4, true, 'M', 4); LINK = file4.GetLinkCode(); file4.Close(); } ClearSearchData(); SetSearchData("COMP_CODE", row["COMP_CD"]); SetSearchData("COMP_NAME", frm.CompName); SetSearchData("SITE_NAME", frm.SiteName); SetSearchData("COMP_TYPE", "V"); SetSearchData("USER_NAME", frm.UserName); SetSearchData("GRADE_NM", frm.Grade); SetSearchData("ADDR_CODE", frm.AddrCode); SetSearchData("ADDR", frm.Addr); SetSearchData("TEL_1", frm.Tel); SetSearchData("FAX", frm.Fax); SetSearchData("EMAIL", frm.Mail); SetSearchData("HOMEPAGE", frm.HomePage); SetSearchData("BANK_CODE", frm.BankCode); SetSearchData("BANK_NO", frm.BankNo); SetSearchData("REG_ID", frm.Regid); SetSearchData("LINK_CODE", LINK); SetSearchData("UPT_USER_ID", DTOFactory.UserId); SetServiceId("SetCompInfo"); try { DTOFactory.Transaction(new MemberDTO()); DataSet ds = DTOFactory.GetDataSet(); ViewMessage.Info("수정이 완료되었습니다."); _dtComp = ds.Tables["ds_comp"]; gd_List.DataSource = _dtComp; _dtUser.Rows.Clear(); } catch (Exception ex) { ViewMessage.Error(ex.Message); } } } else if ("DEL".Equals(view.Columns[e.ColumnIndex].Name)) { if (!"".Equals(row["COMP_CD"].ToString())) { if (System.Windows.Forms.MessageBox.Show( row["COMP_NM"].ToString() + " 업체 정보를 삭제 하시겠습니까?", "업체 제거" , MessageBoxButtons.YesNo) == DialogResult.Yes) { ClearSearchData(); SetSearchData("COMP_CODE", row["COMP_CD"].ToString()); SetServiceId("RemoveComp"); try { DTOFactory.Transaction(new MemberDTO()); _dtComp.Rows.RemoveAt(e.RowIndex); ViewMessage.Info("업체 정보가 삭제 되었습니다."); } catch (Exception ex) { ViewMessage.Error(ex.Message); } } } } } }
private void ActionItemConfirm(object sender, DataGridViewCellEventArgs e) { DataGridView view = (DataGridView)sender; if (e.RowIndex > -1) { DataGridViewRow row = view.Rows[e.RowIndex]; if ("검토완료".Equals(row.Cells[e.ColumnIndex].Value)) { if ("종료".Equals(row.Cells["ACT_STATUS"].Value)) { ViewMessage.Warning("이미 검토가 끝난 항목 입니다."); } else if (!DTOFactory.UserId.Equals(row.Cells["CFM_USER_ID"].Value)) { ViewMessage.Warning("해당 Action Item에 대한 검토 권한이 없습니다."); } else { ClearSearchData(); SetSearchData("WORK_CD", row.Cells["ACT_ID"].Value); SetSearchData("END_TM", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); SetSearchData("STATUS", "C"); SetSearchData("USER_ID", DTOFactory.UserId); SetServiceId("SetActionItemConfirm"); try { DTOFactory.Action(); DTOFactory.Transaction(new MemberDTO()); Mail.Subject = "[검토 완료]" + row.Cells["SUBJECT"].Value; Mail.To = row.Cells["EMAIL"].Value.ToString(); Mail.IsDirect = true; string strBody = "해당 건에 대한 검토가 완료 되었습니다.<br>수고하셨습니다."; Mail.Send(strBody); row.Cells["ACT_STATUS"].Value = "종료"; foreach (DataGridViewCell cell in row.Cells) { cell.Style.BackColor = Color.LightGray; cell.Style.ForeColor = Color.Black; } DTOFactory.Complete(); ViewMessage.Info("Action Item검토가 완료 되었습니다."); } catch (Exception ex) { DTOFactory.Complete(); ViewMessage.Error(ex.Message); } } } else if ("보기".Equals(row.Cells[e.ColumnIndex].Value.ToString())) { if (!"".Equals(row.Cells["LINK"].Value.ToString())) { DTOFactory.Action(); FileGet get = new FileGet(row.Cells["LINK"].Value.ToString()); get.Close(); DTOFactory.Complete(); } else { ViewMessage.Error("등록된 파일이 없습니다."); } } } }
private void ViewLink(object sender, EventArgs e) { FileGet get = new FileGet(dt_file.Rows[lstFile.SelectedIndex]["LINK"].ToString()); get.Close(); }