SVN r535
SVN-Revision: r535
This commit is contained in:
@@ -33,6 +33,10 @@ namespace Lskj.Control
|
||||
/// 存储文件地址(用于保存上传)
|
||||
/// </summary>
|
||||
public string filepath;
|
||||
/// <summary>
|
||||
/// 存储原文件名
|
||||
/// </summary>
|
||||
public string lasttext;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -51,8 +55,45 @@ namespace Lskj.Control
|
||||
private void OnDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
|
||||
txtEdit.Text = Path.GetFileName(file);
|
||||
this.filepath = file;
|
||||
string filename = Path.GetFileName(file);
|
||||
if (!string.IsNullOrEmpty(lasttext))
|
||||
{
|
||||
if (string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
MessageUtil.Show("检测到更改文件和原文件完全一样!");
|
||||
}
|
||||
else
|
||||
{
|
||||
string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase);
|
||||
string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase);
|
||||
if (string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
txtEdit.Text = filename;
|
||||
this.filepath = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件不匹配!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 取出最后一次出现 "-S" 之前的部分(不含扩展名)
|
||||
/// </summary>
|
||||
private static string GetPrefixBeforeLastS(string fileName, StringComparison comp)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileName)) return string.Empty;
|
||||
|
||||
// 1) 去掉扩展名
|
||||
int dot = fileName.LastIndexOf('.');
|
||||
string noExt = dot >= 0 ? fileName.Substring(0, dot) : fileName;
|
||||
|
||||
// 2) 找最后一次出现 "-S"
|
||||
int pos = noExt.LastIndexOf("-S", comp);
|
||||
return pos >= 0 ? noExt.Substring(0, pos) : noExt;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:移动到目标表格</para>
|
||||
|
||||
@@ -2497,7 +2497,7 @@ namespace Lskj.Control.Model
|
||||
imageEdit.TextEdit.Image = null;
|
||||
}
|
||||
//清空多选选中值
|
||||
else if (model.FieldType == ControlType.LabMultiSelectValue|| model.FieldType == ControlType.LabMultiSelectValueNew )
|
||||
else if (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabMultiSelectValueNew)
|
||||
{
|
||||
LabelMultiAutoTextEdit multiEdit = control as LabelMultiAutoTextEdit;
|
||||
multiEdit.ClearSelectForm();
|
||||
@@ -2737,7 +2737,7 @@ namespace Lskj.Control.Model
|
||||
if (item is BaseUserControl)
|
||||
{
|
||||
var baseControl = item as BaseUserControl;
|
||||
if (baseControl.Model.ImportReturnValue|| baseControl.Model.ImportCurrentValue)
|
||||
if (baseControl.Model.ImportReturnValue || baseControl.Model.ImportCurrentValue)
|
||||
{
|
||||
names.Add(baseControl.Model.FieldName);
|
||||
}
|
||||
@@ -2980,23 +2980,23 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
this.Print(primaryValue, this.SystemModel.PrintFile);
|
||||
}
|
||||
|
||||
|
||||
//打印文件
|
||||
if (resultMsgs[i].Contains("printfile="))
|
||||
{
|
||||
string[] files = resultMsgs[i].Split('=');
|
||||
string parameter =string.Empty;
|
||||
if (resultMsgs[i].Contains("^"))
|
||||
string parameter = string.Empty;
|
||||
if (resultMsgs[i].Contains("^"))
|
||||
{
|
||||
//printfile=成品入库标签.rmf|xxxx.rmf^参数1=参数1值|参数2=参数2值
|
||||
//多个打印模块用|分割
|
||||
//替换参数用 ^ 隔开,多个用|分割
|
||||
string[] parameters = resultMsgs[i].Split('^');
|
||||
files= parameters[0].Split('=');
|
||||
files = parameters[0].Split('=');
|
||||
parameter = parameters[1];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (files.Length == 2 && !string.IsNullOrEmpty(files[1]))
|
||||
{
|
||||
@@ -3008,7 +3008,7 @@ namespace Lskj.Control.Model
|
||||
this.Print(primaryValue, printFiles[n], parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 模块
|
||||
if (resultMsgs[i].Contains("module="))
|
||||
@@ -3136,7 +3136,7 @@ namespace Lskj.Control.Model
|
||||
//SetTopRowHandle(oldTopRowHandle);
|
||||
}
|
||||
//执行删除或者右键后,主表没有数据时清空明细表格数据
|
||||
if (this.GridRowCount ==0&& OnLastQueryTriggered != null) OnLastQueryTriggered(null, null);
|
||||
if (this.GridRowCount == 0 && OnLastQueryTriggered != null) OnLastQueryTriggered(null, null);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3323,11 +3323,17 @@ namespace Lskj.Control.Model
|
||||
SerSearchBoxDataSource(baseControl, controlValue + "");
|
||||
}
|
||||
}
|
||||
|
||||
if (baseControl is LabelImageEdit)
|
||||
{
|
||||
LabelImageEdit imageEdit = baseControl as LabelImageEdit;
|
||||
imageEdit.LoadImage(controlValue + "");
|
||||
}
|
||||
else if (baseControl is LabelRemarkEdit && baseControl.Model.FileUploadControl)
|
||||
{
|
||||
LabelRemarkEdit labelRemarkEdit = baseControl as LabelRemarkEdit;
|
||||
labelRemarkEdit.lasttext = controlValue + "";
|
||||
}
|
||||
else if (baseControl is LabelPictureEdit)
|
||||
{
|
||||
Image image = null;
|
||||
@@ -3756,7 +3762,7 @@ namespace Lskj.Control.Model
|
||||
model.IsSave = true;
|
||||
model.Visible = item.Table.Columns.Contains("visible") ? "1".Equals(item["visible"] + "") : false;
|
||||
model.FieldType = string.IsNullOrEmpty(item["fieldTypeId"] + "") ? 0 : Convert.ToInt32(item["fieldTypeId"] + "");
|
||||
if (model.FieldType==42)
|
||||
if (model.FieldType == 42)
|
||||
{
|
||||
model.FieldType = 116;
|
||||
}
|
||||
@@ -4085,7 +4091,7 @@ namespace Lskj.Control.Model
|
||||
remarkEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||
if (!isLoadBorder) remarkEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
baseControl = remarkEdit;
|
||||
if (!model.FileUploadControl)
|
||||
if (model.FileUploadControl)
|
||||
{
|
||||
remarkEdit.BandAllowDrop();
|
||||
}
|
||||
@@ -5055,7 +5061,7 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="printFile">The print file.</param>
|
||||
private void Print(string value, string printFile,string parameter="")
|
||||
private void Print(string value, string printFile, string parameter = "")
|
||||
{
|
||||
if (SystemModel == null) return;
|
||||
string printPath = PubUtil.PrintFileAbsolutelyPath;
|
||||
@@ -5079,17 +5085,17 @@ namespace Lskj.Control.Model
|
||||
string tmpSql = this.ReplaceControlValue(this.SystemModel.PrintSql);
|
||||
string tmpSql1 = this.ReplaceControlValue(this.SystemModel.PrintSql1);
|
||||
string tmpSql2 = this.ReplaceControlValue(this.SystemModel.PrintSql2);
|
||||
if (!string.IsNullOrWhiteSpace(parameter))
|
||||
if (!string.IsNullOrWhiteSpace(parameter))
|
||||
{
|
||||
string[] parameters = parameter.Split('|');
|
||||
foreach (string item in parameters)
|
||||
{
|
||||
string[] Replacing= item.Split('=');
|
||||
tmpSql =ReplaceHelper.ReplaceParamToValue(tmpSql, Replacing[0], Replacing[1]);
|
||||
string[] Replacing = item.Split('=');
|
||||
tmpSql = ReplaceHelper.ReplaceParamToValue(tmpSql, Replacing[0], Replacing[1]);
|
||||
tmpSql1 = ReplaceHelper.ReplaceParamToValue(tmpSql1, Replacing[0], Replacing[1]);
|
||||
tmpSql2 = ReplaceHelper.ReplaceParamToValue(tmpSql2, Replacing[0], Replacing[1]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user