Added "Move"-button for copy

This commit is contained in:
2015-09-24 12:07:15 +02:00
parent ecf4e0a7da
commit 49164122d8
2 changed files with 62 additions and 25 deletions

View File

@ -25,6 +25,7 @@ namespace CobXmlSupport
bool bSynch;
string finalFileSafe;
string wholeFilePath;
string existing = "";
public savedFile SavedFile { get; set; }
@ -33,6 +34,7 @@ namespace CobXmlSupport
InitializeComponent();
oldTxt = "";
bSynch = false;
btnMoveToLib.Enabled = false;
}
public bool BSynch
@ -61,7 +63,7 @@ namespace CobXmlSupport
set
{
wholeFilePath = value;
lblCodeType.Text = wholeFilePath.Substring(wholeFilePath.LastIndexOf("\\")+1); ;
lblCodeType.Text = wholeFilePath.Substring(wholeFilePath.LastIndexOf("\\") + 1); ;
}
}
@ -100,9 +102,9 @@ namespace CobXmlSupport
private void btnSynch_Click(object sender, EventArgs e)
{
codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text,parentWindow.FldPref);
codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text, parentWindow.FldPref);
string fieldCompl = "";
this.CodeShower.Text = " InPath = " + Cc.PathId + "\r\n InFile = " + Cc.FileId + "\r\n codeFile = " + Cc.CcFileInId + "\r\n codePath = " + Cc.PathId+Cc.CcFileInId + "\r\n -------------- \r\n" + this.CodeShower.Text;
this.CodeShower.Text = " InPath = " + Cc.PathId + "\r\n InFile = " + Cc.FileId + "\r\n codeFile = " + Cc.CcFileInId + "\r\n codePath = " + Cc.PathId + Cc.CcFileInId + "\r\n -------------- \r\n" + this.CodeShower.Text;
Cc.TryFill_In_Dic();
foreach (CobRow cr in parentWindow.RowList)
@ -117,7 +119,7 @@ namespace CobXmlSupport
}
}
if (cr.MoveCode == null) { cr.MoveCode = " "; }
Cc.WorkDicIn[cr.FieldName]=cr.MoveCode;
Cc.WorkDicIn[cr.FieldName] = cr.MoveCode;
}
}
@ -307,7 +309,7 @@ namespace CobXmlSupport
private void btnSynchOut_Click(object sender, EventArgs e)
{
codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text,parentWindow.FldPref);
codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text, parentWindow.FldPref);
string fieldCompl = "";
this.CodeShower.Text = " InPath = " + Cc.PathId + "\r\n InFile = " + Cc.FileId + "\r\n codeFile = " + Cc.CcFileOutId + "\r\n codePath = " + Cc.PathId + Cc.CcFileOutId + "\r\n -------------- \r\n" + this.CodeShower.Text;
Cc.TryFill_Out_Dic();
@ -363,16 +365,34 @@ namespace CobXmlSupport
private void btnCompare_Click(object sender, EventArgs e)
{
existing = "";
try
{
string existing = finalFileSafe.Substring(finalFileSafe.LastIndexOf("\\")+1);
existing = finalFileSafe.Substring(finalFileSafe.LastIndexOf("\\") + 1);
Process.Start("C:\\Program Files (x86)\\WinMerge\\WinMergeU.exe", finalFileSafe + " Q:\\kII20\\cpy\\" + existing);
}
catch (Exception ex)
{
MessageBox.Show("Problem vid starta WinMerge :" + ex.Message);
}
btnMoveToLib.Enabled = true;
}
private void btnMoveToLib_Click(object sender, EventArgs e)
{
try
{
if (DialogResult.OK == MessageBox.Show("Ok att kopiera :" + finalFileSafe + "\r\ntill Q:\\kII20\\cpy\\" + existing, "Kopiering", MessageBoxButtons.OKCancel))
{
File.Copy(finalFileSafe, "Q:\\kII20\\cpy\\" + existing);
btnMoveToLib.Enabled = false;
}
}
catch (Exception ex)
{
MessageBox.Show("Problem vid filkopiering :" + ex.Message);
}
}
}