메모장에 폴더 연결 기능 추가 - 차후에 전용 폴더 뷰어를 연결해야 함
This commit is contained in:
@@ -11,13 +11,14 @@ namespace FPJ0000.Note
|
||||
{
|
||||
public partial class fNote_Add : Form
|
||||
{
|
||||
dsPRJ.EETGW_NoteRow dr;
|
||||
int idx = -1;
|
||||
Boolean copyMOde = false;
|
||||
Boolean bInit = false;
|
||||
public fNote_Add(dsPRJ.EETGW_NoteRow dr_, Boolean copy = false)
|
||||
string sGUID = string.Empty;
|
||||
public fNote_Add(int idx_, Boolean copy = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
dr = dr_;
|
||||
this.idx = idx_;
|
||||
this.KeyPreview = true;
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
this.KeyDown += (s1, e1) =>
|
||||
@@ -38,52 +39,62 @@ namespace FPJ0000.Note
|
||||
|
||||
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 (this.idx == -1)
|
||||
{
|
||||
if (dr.uid != FCOMMON.info.Login.no) checkBox1.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(dr.description2))
|
||||
{
|
||||
this.richTextBoxEx1.Text = dr.description;
|
||||
//신규추가임
|
||||
this.dtPdate.Value = DateTime.Now;
|
||||
cmbUser.SelectedValue = FCOMMON.info.Login.no;
|
||||
checkBox1.Checked = false;
|
||||
richTextBoxEx1.Text = string.Empty;
|
||||
sGUID = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
var db = new EEEntities();
|
||||
var dr = db.EETGW_Note.Where(t => t.idx == this.idx).FirstOrDefault();
|
||||
dtPdate.Value = DateTime.Parse(dr.pdate);
|
||||
cmbUser.SelectedValue = dr.uid;
|
||||
checkBox1.Checked = (bool)dr.share;
|
||||
tbTitle.Text = dr.title;
|
||||
sGUID = dr.guid;
|
||||
|
||||
//내가 작성한 글이 아니면 공유를 지정할 수 없게 한다.
|
||||
if (dr.uid != FCOMMON.info.Login.no)
|
||||
{
|
||||
this.richTextBoxEx1.Rtf = dr.description2;
|
||||
checkBox1.Enabled = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sGUID.isEmpty())
|
||||
sGUID = Guid.NewGuid().ToString();
|
||||
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
|
||||
this.richTextBoxEx1.Focus();
|
||||
|
||||
bInit = true;
|
||||
@@ -139,15 +150,44 @@ namespace FPJ0000.Note
|
||||
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();
|
||||
//바로저장한다.
|
||||
var db = new EEEntities();
|
||||
if(idx == -1)
|
||||
{
|
||||
//신규
|
||||
var dr = new EETGW_Note();
|
||||
dr.wuid = FCOMMON.info.Login.no;
|
||||
dr.wdate = DateTime.Now;
|
||||
dr.pdate = dtPdate.Value.ToShortDateString();
|
||||
dr.uid = cmbUser.SelectedValue.ToString();
|
||||
dr.description = richTextBoxEx1.Text;
|
||||
dr.description2 = richTextBoxEx1.Rtf;
|
||||
dr.share = checkBox1.Checked;
|
||||
dr.title = tbTitle.Text;
|
||||
dr.guid = this.sGUID;
|
||||
dr.gcode = FCOMMON.info.Login.gcode;
|
||||
db.EETGW_Note.Add(dr);
|
||||
db.SaveChanges();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//기존
|
||||
var dr = db.EETGW_Note.Where(t => t.idx == this.idx).FirstOrDefault();
|
||||
if(dr != null)
|
||||
{
|
||||
dr.wuid = FCOMMON.info.Login.no;
|
||||
dr.wdate = DateTime.Now;
|
||||
dr.pdate = dtPdate.Value.ToShortDateString();
|
||||
dr.uid = cmbUser.SelectedValue.ToString();
|
||||
dr.description = richTextBoxEx1.Text;
|
||||
dr.description2 = richTextBoxEx1.Rtf;
|
||||
dr.share = checkBox1.Checked;
|
||||
dr.guid = this.sGUID;
|
||||
dr.title = tbTitle.Text;
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
|
||||
@@ -168,5 +208,30 @@ namespace FPJ0000.Note
|
||||
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
var serverpath = Properties.Settings.Default.SharePath; // @"\\10.131.32.29\Data\Project";
|
||||
if (System.IO.Directory.Exists(serverpath) == false)
|
||||
{
|
||||
FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" +
|
||||
serverpath);
|
||||
return;
|
||||
}
|
||||
|
||||
var path = serverpath + "\\Note\\" + this.sGUID;
|
||||
if (System.IO.Directory.Exists(path) == false)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(path);
|
||||
}
|
||||
catch (Exception eX)
|
||||
{
|
||||
FCOMMON.Util.MsgE("프로젝트 저장소 생성실패\n" + eX.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
FCOMMON.Util.RunExplorer(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user