102 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			102 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| using YARTE.UI.Buttons;
 | |
| 
 | |
| namespace FCM0000
 | |
| {
 | |
|     public partial class fMailform : FCOMMON.fBase
 | |
|     {
 | |
|         public fMailform()
 | |
|         {
 | |
|             InitializeComponent();
 | |
|             PredefinedButtonSets.SetupDefaultButtons(this.htmlEditor1);
 | |
|             this.dsMSSQL.MailForm.TableNewRow += MailForm_TableNewRow;
 | |
|         }
 | |
| 
 | |
|         void MailForm_TableNewRow(object sender, DataTableNewRowEventArgs e)
 | |
|         {
 | |
|             e.Row["wuid"] = FCOMMON.info.Login.no;
 | |
|             e.Row["wdate"] = DateTime.Now;
 | |
|             e.Row["subject"] = "메일제목";
 | |
|             e.Row["title"] = "분류제목";
 | |
|             e.Row["cate"] = "NR";
 | |
|         }
 | |
| 
 | |
|         private void fMailform_Load(object sender, EventArgs e)
 | |
|         {
 | |
|             refreshData();
 | |
|         }
 | |
| 
 | |
|         void refreshData()
 | |
|         {
 | |
|             try
 | |
|             {
 | |
|                 ta.Fill(this.dsMSSQL.MailForm);
 | |
|             }
 | |
|             catch (Exception ex)
 | |
|             {
 | |
|                 FCOMMON.Util.MsgE(ex.Message);
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         private void mailFormBindingNavigatorSaveItem_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             this.Validate();
 | |
|             this.bs.EndEdit();
 | |
|             this.tam.UpdateAll(this.dsMSSQL);
 | |
| 
 | |
|         }
 | |
| 
 | |
|         private void toolStripButton1_Click(object sender, EventArgs e)
 | |
|         {
 | |
|            
 | |
|         }
 | |
|         dsMSSQL.MailFormRow dr = null;
 | |
|         private void bs_CurrentChanged(object sender, EventArgs e)
 | |
|         {
 | |
|             var drv = this.bs.Current as DataRowView;
 | |
|             if (drv == null) return;
 | |
|             dr = drv.Row as dsMSSQL.MailFormRow;
 | |
|             this.htmlEditor1.Html = dr.body;
 | |
|             //this.htmlEditor2.Html = dr.tail;
 | |
|         }
 | |
| 
 | |
|         private void richTextBox2_Validated(object sender, EventArgs e)
 | |
|         {
 | |
|           
 | |
|         }
 | |
| 
 | |
|         private void htmlEditor1_Validated(object sender, EventArgs e)
 | |
|         {
 | |
|             if (dr != null)
 | |
|             {
 | |
|                 dr.body = this.htmlEditor1.Html;
 | |
|                // dr.tail = this.htmlEditor2.Html;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         private void mailFormDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 | |
|         {
 | |
| 
 | |
|         }
 | |
| 
 | |
|         private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             var dlg = FCOMMON.Util.MsgQ("선택된 자료를 삭제하시겠습니까?");
 | |
|             if (dlg != System.Windows.Forms.DialogResult.Yes) return;
 | |
|             bs.RemoveCurrent();
 | |
|         }
 | |
| 
 | |
|         private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
 | |
|         {
 | |
| 
 | |
|         }
 | |
|     }
 | |
| }
 | 
