업무일지 입력창을 rtf 로 변경
This commit is contained in:
@@ -14,7 +14,7 @@ namespace FPJ0000.JobReport
|
||||
dsPRJ.JobReportRow dr;
|
||||
Boolean copyMOde = false;
|
||||
Boolean bInit = false;
|
||||
public fJobReport_Add(dsPRJ.JobReportRow dr_,Boolean copy=false)
|
||||
public fJobReport_Add(dsPRJ.JobReportRow dr_, Boolean copy = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
dr = dr_;
|
||||
@@ -38,16 +38,16 @@ namespace FPJ0000.JobReport
|
||||
|
||||
void tbProject_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (bInit==false || this.tbProject.SelectedIndex < 0) return;
|
||||
if (bInit == false || this.tbProject.SelectedIndex < 0) return;
|
||||
var data = this.tbProject.SelectedValue;
|
||||
if (data == null) return;
|
||||
if(data.GetType() == typeof(DataRowView))
|
||||
if (data.GetType() == typeof(DataRowView))
|
||||
{
|
||||
var drv = data as DataRowView;
|
||||
var idx = int.Parse(drv["Code"].ToString());
|
||||
tbProjectIndex.Text = idx.ToString();
|
||||
tbProject.Tag = tbProject.Text;
|
||||
Console.WriteLine(string.Format("Project Select #1 {0}:{1}",idx,tbProject.Text));
|
||||
Console.WriteLine(string.Format("Project Select #1 {0}:{1}", idx, tbProject.Text));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -137,13 +137,29 @@ namespace FPJ0000.JobReport
|
||||
if (dr.RowState == DataRowState.Detached || dr.RowState == DataRowState.Added) chkAutoAdd.Enabled = true;
|
||||
else chkAutoAdd.Enabled = false;
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(dr.description2))
|
||||
{
|
||||
this.richTextBoxEx1.Text = dr.description;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.richTextBoxEx1.Rtf = dr.description2;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.richTextBoxEx1.Text = dr.description;
|
||||
}
|
||||
}
|
||||
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
|
||||
if(tbDescription.Text.Trim() != "")
|
||||
if (this.richTextBoxEx1.Text.Trim() != "")
|
||||
{
|
||||
tbDescription.Focus();
|
||||
tbDescription.SelectAll();
|
||||
this.richTextBoxEx1.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -151,9 +167,23 @@ namespace FPJ0000.JobReport
|
||||
tbProject.SelectAll();
|
||||
}
|
||||
tbProject.Tag = tbProject.Text;
|
||||
|
||||
// if (string.IsNullOrEmpty(richTextBox1.Text)) richTextBox1.Text = dr.description;
|
||||
|
||||
//editor
|
||||
// ed = new editform.editor();
|
||||
//ed.AllowDiscAccess = true;
|
||||
//ed.WindowTitle = "Quick Edit";
|
||||
//ed.StartingFont = new Font("Courier New", 12.0f, FontStyle.Regular);
|
||||
|
||||
//ed.DisplayEditForm(this.panel1);
|
||||
//ed.AllowRtf = true;
|
||||
|
||||
|
||||
|
||||
bInit = true;
|
||||
}
|
||||
|
||||
// editform.editor ed;
|
||||
void ctl_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
@@ -249,16 +279,16 @@ namespace FPJ0000.JobReport
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Invalidate();
|
||||
if(tbProject.Text.Trim() == "")
|
||||
if (tbProject.Text.Trim() == "")
|
||||
{
|
||||
FCOMMON.Util.MsgE("프로젝트(아이템) 명칭이 없습니다.");
|
||||
tbProject.Focus();
|
||||
tbProject.Focus();
|
||||
return;
|
||||
}
|
||||
if (cmbType.Text != "휴가" && tbDescription.Text.Trim() == "")
|
||||
if (cmbType.Text != "휴가" && string.IsNullOrEmpty( this.richTextBoxEx1.Text )==true)
|
||||
{
|
||||
FCOMMON.Util.MsgE("진행 내용이 없습니다.");
|
||||
tbDescription.Focus();
|
||||
this.richTextBoxEx1.Focus();
|
||||
return;
|
||||
}
|
||||
float hour = Single.Parse(tbHrs.Text) + Single.Parse(tbOt.Text);
|
||||
@@ -289,11 +319,11 @@ namespace FPJ0000.JobReport
|
||||
return;
|
||||
}
|
||||
|
||||
if(tbProject.Tag.ToString() != tbProject.Text && tbProjectIndex.Text != "" && tbProjectIndex.Text != "-1")
|
||||
if (tbProject.Tag.ToString() != tbProject.Text && tbProjectIndex.Text != "" && tbProjectIndex.Text != "-1")
|
||||
{
|
||||
FCOMMON.Util.MsgE("프로젝트가 선택되었으나 이름이 임의 수정되어 프로젝트 연결을 해제 합니다\n\n" +
|
||||
"잘못된 프로젝트명은 프로젝트 관리화면에서 변경하시기 바랍니다.\n\n"+
|
||||
"원본 : " + tbProject.Tag.ToString() + "\n" +
|
||||
"잘못된 프로젝트명은 프로젝트 관리화면에서 변경하시기 바랍니다.\n\n" +
|
||||
"원본 : " + tbProject.Tag.ToString() + "\n" +
|
||||
"현재 : " + tbProject.Text);
|
||||
tbProjectIndex.Text = "-1";
|
||||
}
|
||||
@@ -315,9 +345,9 @@ namespace FPJ0000.JobReport
|
||||
}
|
||||
}
|
||||
|
||||
if(chkAutoAdd.Checked && (dr.RowState == DataRowState.Detached || dr.RowState == DataRowState.Added))
|
||||
if (chkAutoAdd.Checked && (dr.RowState == DataRowState.Detached || dr.RowState == DataRowState.Added))
|
||||
{
|
||||
if(tbProjectIndex.Text == "" || tbProjectIndex.Text == "-1")
|
||||
if (tbProjectIndex.Text == "" || tbProjectIndex.Text == "-1")
|
||||
{
|
||||
FCOMMON.Util.MsgE("프로젝트 주간내역을 등록하려면 프로젝트가 지정되어야 합니다");
|
||||
tbProject.Focus();
|
||||
@@ -327,7 +357,7 @@ namespace FPJ0000.JobReport
|
||||
else
|
||||
{
|
||||
//190906
|
||||
FCOMMON.DBM.addProjectHistory(int.Parse(tbProjectIndex.Text), dtPdate.Value.ToShortDateString(), tbDescription.Text.Trim());
|
||||
FCOMMON.DBM.addProjectHistory(int.Parse(tbProjectIndex.Text), dtPdate.Value.ToShortDateString(), this.richTextBoxEx1.Text, this.richTextBoxEx1.Rtf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +375,11 @@ namespace FPJ0000.JobReport
|
||||
else this.dr.hrs = 0;
|
||||
if (tbOt.Text != "") this.dr.ot = double.Parse(tbOt.Text);
|
||||
else this.dr.ot = 0;
|
||||
this.dr.description = tbDescription.Text.Trim();
|
||||
//this.dr.description = richTextBox1.Text.Trim();
|
||||
|
||||
//MessageBox.Show(richTextBox1.Text);
|
||||
this.dr.description = richTextBoxEx1.Text;
|
||||
this.dr.description2 = richTextBoxEx1.Rtf; // ef.DocumentText;// richTextBox1.Rtf;
|
||||
this.bs.EndEdit();
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
@@ -391,7 +425,7 @@ namespace FPJ0000.JobReport
|
||||
if (hrs != 0)
|
||||
{
|
||||
FCOMMON.Util.MsgI("공휴일에는 근무시간을 입력할 수 없습니다.\n초과시간에 입력하세요.\n\n해당 값은 삭제 됩니다.");
|
||||
dr.hrs = 0;
|
||||
dr.hrs = 0;
|
||||
tbHrs.Text = "0";
|
||||
if (hrs != 8) tbOt.Text = hrs.ToString();
|
||||
tbOt.Focus();
|
||||
|
||||
Reference in New Issue
Block a user