173 lines
5.9 KiB
C#
173 lines
5.9 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;
|
|
|
|
namespace FPJ0000.Note
|
|
{
|
|
public partial class fNote_Add : Form
|
|
{
|
|
dsPRJ.EETGW_NoteRow dr;
|
|
Boolean copyMOde = false;
|
|
Boolean bInit = false;
|
|
public fNote_Add(dsPRJ.EETGW_NoteRow dr_, Boolean copy = false)
|
|
{
|
|
InitializeComponent();
|
|
dr = dr_;
|
|
this.KeyPreview = true;
|
|
this.StartPosition = FormStartPosition.CenterScreen;
|
|
this.KeyDown += (s1, e1) =>
|
|
{
|
|
if (e1.KeyCode == Keys.Escape) this.Close();
|
|
};
|
|
|
|
foreach (Control ctl in this.panel1.Controls)
|
|
{
|
|
if (ctl.GetType() == typeof(TextBox) || ctl.GetType() == typeof(ComboBox))
|
|
{
|
|
ctl.KeyDown += ctl_KeyDown;
|
|
}
|
|
}
|
|
copyMOde = copy;
|
|
}
|
|
|
|
|
|
private void fJobReport_Add_Load(object sender, EventArgs e)
|
|
{
|
|
//사용자목록
|
|
this.bs.DataSource = dr;
|
|
|
|
//해당 사용자에 걸린 프로젝트 목록 가져오기
|
|
var userProject = FCOMMON.DBM.getUserProjectList(FCOMMON.info.Login.nameK);
|
|
|
|
|
|
//담당자목록
|
|
|
|
var dt_users = FCOMMON.DBM.getUserTable();// getGroupList("name + '(' + id + ')'", "Users", "[level] > 0 and [level] < 10", false, false);
|
|
this.cmbUser.DisplayMember = "dispName";
|
|
this.cmbUser.ValueMember = "id";
|
|
this.cmbUser.DataSource = dt_users;
|
|
if (FCOMMON.info.Login.level < 5) cmbUser.Enabled = false;
|
|
|
|
// tbWW.Text = dr.ww;
|
|
dtPdate.Value = DateTime.Parse(dr.pdate); //일자선택
|
|
cmbUser.SelectedValue = dr.uid;
|
|
checkBox1.Checked = dr.share;
|
|
|
|
//편집모드인데. 내가 작성자가 아니면 공유를 설정하지 못하게한다
|
|
if(dr.RowState == DataRowState.Unchanged || dr.RowState == DataRowState.Modified)
|
|
{
|
|
if (dr.uid != FCOMMON.info.Login.no) checkBox1.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();
|
|
|
|
this.richTextBoxEx1.Focus();
|
|
|
|
bInit = true;
|
|
}
|
|
// editform.editor ed;
|
|
void ctl_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
{
|
|
Control ctl = sender as Control;
|
|
string nm = ctl.Name.ToLower();
|
|
string search = ctl.Text.Trim();
|
|
|
|
Console.WriteLine("inner keydown " + nm + ":" + search);
|
|
|
|
switch (nm)
|
|
{
|
|
//case "cmbrequest":
|
|
|
|
// //요청자가 마지막으로 입력한 자료의 process 를 찾아서 기입해준다.
|
|
// var lastprocess = FCOMMON.DBM.getFirstValue("process", "purchase", "request like '%" + this.cmbUser.Text + "%'", "pdate desc");
|
|
// if (lastprocess != "") cbProcess.Text = lastprocess;
|
|
// tbSID.Focus();
|
|
// break;
|
|
case "tbdescription":
|
|
if (e.Control)
|
|
{
|
|
btSave.Focus();
|
|
}
|
|
break;
|
|
|
|
default:
|
|
SendKeys.Send("{TAB}");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
{
|
|
FCM0000.fSelectDate f = new FCM0000.fSelectDate(this.dtPdate.Value.ToShortDateString());
|
|
if (f.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
|
|
dtPdate.Value = f.dtSelect;
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
this.Invalidate();
|
|
|
|
if (cmbUser.SelectedIndex < 0)
|
|
{
|
|
FCOMMON.Util.MsgE("담당자가 선택되지 않았습니다.");
|
|
cmbUser.Focus();
|
|
return;
|
|
}
|
|
|
|
|
|
this.dr.uid = this.cmbUser.SelectedValue.ToString();
|
|
this.dr.pdate = dtPdate.Value.ToShortDateString();
|
|
this.dr.description = richTextBoxEx1.Text;
|
|
this.dr.description2 = richTextBoxEx1.Rtf; // ef.DocumentText;// richTextBox1.Rtf;
|
|
this.dr.share = checkBox1.Checked;
|
|
this.dr.wuid = FCOMMON.info.Login.no;
|
|
this.dr.wdate = DateTime.Now;
|
|
this.bs.EndEdit();
|
|
DialogResult = System.Windows.Forms.DialogResult.OK;
|
|
}
|
|
|
|
|
|
private void dtPdate_ValueChanged(object sender, EventArgs e)
|
|
{
|
|
var myCI = new System.Globalization.CultureInfo("ko-KR");
|
|
var myCal = myCI.Calendar;
|
|
var myCWR = myCI.DateTimeFormat.CalendarWeekRule;
|
|
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
|
|
var dat = myCal.GetWeekOfYear(dtPdate.Value, myCWR, myFirstDOW);
|
|
tbWW.Text = "ww" + dat.ToString();
|
|
|
|
}
|
|
|
|
private void cmbUser_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
}
|