提交当前本机整理版本
This commit is contained in:
Generated
+19
-1
@@ -691,4 +691,22 @@
|
||||
private GridControlEx gridFinish;
|
||||
private DevExpress.XtraEditors.PanelControl pl_top;
|
||||
private DevExpress.XtraEditors.PanelControl pl_top_searchCond;
|
||||
private LabelCheckDa
|
||||
private LabelCheckDateEdit labeldate_start;
|
||||
private LabelCheckAutoTextEdit labelcheck_finalAuditor;
|
||||
private LabelTextEdit labeltxt_dataFlag;
|
||||
private DevExpress.XtraEditors.SimpleButton btnSearch;
|
||||
private LabelCheckDateEdit labeldate_end;
|
||||
private DevExpress.XtraEditors.PanelControl pl_top_right;
|
||||
private DevExpress.XtraEditors.SimpleButton simpleButton1;
|
||||
private DevExpress.XtraEditors.SimpleButton btnBackTop;
|
||||
public DevExpress.XtraEditors.SimpleButton simpleButton2;
|
||||
private DevExpress.XtraEditors.DropDownButton dbpFP;
|
||||
private DevExpress.XtraBars.BarDockControl barDockControl3;
|
||||
private DevExpress.XtraBars.BarDockControl barDockControl5;
|
||||
private DevExpress.XtraBars.BarDockControl barDockControl2;
|
||||
private DevExpress.XtraBars.BarDockControl barDockControl1;
|
||||
private DevExpress.XtraBars.PopupMenu pmFP;
|
||||
private DevExpress.XtraBars.BarManager barManager2;
|
||||
public GridControlEx gcDetail;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3578,4 +3578,35 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
{
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
LogUtil.WriteError("计算列计算公式--错误-->" + rowItem[gridModel.FieldName], ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
// MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置修改过的控件颜色
|
||||
/// </summary>
|
||||
public void SetColor()
|
||||
{
|
||||
this.ControlObj.SetClearBackgroundColor();
|
||||
List<string> FieldList = AuditChangeLog.GetChangeLogFields(this.SysModel.BillDocumentId);
|
||||
foreach (string item in FieldList)
|
||||
{
|
||||
this.ControlObj.SetBackgroundColor(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -118,12 +118,18 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="pMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>349, 15</value>
|
||||
<value>233, 17</value>
|
||||
</metadata>
|
||||
<metadata name="barManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>458, 15</value>
|
||||
<value>327, 17</value>
|
||||
</metadata>
|
||||
<metadata name="pmFP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="barManager2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>102, 17</value>
|
||||
</metadata>
|
||||
<metadata name="pMprint.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>614, 15</value>
|
||||
<value>458, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -1656,4 +1656,33 @@ namespace Lskj.Control
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new EventHandler(delegate
|
||||
|
||||
{
|
||||
int second = Convert.ToInt32((endTime - beginTime).TotalSeconds);
|
||||
string tipMsg = "数据筛选完成.";
|
||||
this.Popup.LabelObj.Text = second > 0 ? string.Format(tipMsg + "(耗时{0}秒)", second) : tipMsg;
|
||||
this.Popup.GridControlObj.DataSource = table;
|
||||
//this.DataSourceTable = table.Copy();
|
||||
this._working = false;
|
||||
this.CalcFormAndGrid(true);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注销时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDisposed(object sender, EventArgs e)
|
||||
{
|
||||
this._popup?.Dispose();
|
||||
this._popup = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1386,4 +1386,41 @@ namespace Lskj.Control
|
||||
{
|
||||
int second = Convert.ToInt32((endTime - beginTime).TotalSeconds);
|
||||
string tipMsg = "数据筛选完成.";
|
||||
this.Popup.LabelObj.Text =
|
||||
this.Popup.LabelObj.Text = second > 0 ? string.Format(tipMsg + "(耗时{0}秒)", second) : tipMsg;
|
||||
this.Popup.GridControlObj.DataSource = table;
|
||||
this._working = false;
|
||||
//this.CalcFormAndGrid();
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 搜索回调
|
||||
/// </summary>
|
||||
public void SearchCallBack()
|
||||
{
|
||||
this.HidePopup();
|
||||
if (this.OnSearchCallBack != null)
|
||||
{
|
||||
OnSearchCallBack(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注销时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDisposed(object sender, EventArgs e)
|
||||
{
|
||||
this._popup?.Dispose();
|
||||
this._popup = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -827,4 +827,34 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="KeyEvnentArgs"/> instance containing the event data.</param>
|
||||
prot
|
||||
protected void OnAutoGridLookUpKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
this._popup.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RefreshPopupDataSource(this.Text.Contains(",") ? string.Empty : this.Text);
|
||||
if (string.IsNullOrWhiteSpace(this.Text))
|
||||
{
|
||||
this.EditText = this.Text;
|
||||
}
|
||||
}
|
||||
this.ShowPopup();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:释放时清理数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-16 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
private void OnDisposed(object sender, EventArgs e)
|
||||
{
|
||||
this._popup?.Dispose();
|
||||
this._popup = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3396,4 +3396,24 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
/// 设置数值的编辑格式
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void GridView_ShowingEditor(object sender, CancelEventArgs e)
|
||||
{
|
||||
GridColumn gridColumn = bandedGridView.FocusedColumn;
|
||||
if (gridColumn != null && gridColumn.Tag != null)
|
||||
{
|
||||
GridColumnModel model = (GridColumnModel)gridColumn.Tag;
|
||||
if (model.FormatEditBox && (model.FieldType == ControlType.LabTextInt || model.FieldType == ControlType.LabCalcText || model.FieldType == ControlType.LabAccount) && gridColumn.RealColumnEdit != null && !gridColumn.RealColumnEdit.EditFormat.FormatString.Equals(model.DataFormat))
|
||||
{
|
||||
gridColumn.RealColumnEdit.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
|
||||
gridColumn.RealColumnEdit.EditFormat.FormatString = model.DataFormat;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,4 +143,35 @@ namespace Lskj.Control
|
||||
/// <param name="panel"></param>
|
||||
protected void GetCharWidthMultilingual(Label label, string text, Panel panel)
|
||||
{
|
||||
|
||||
//之前只对非中文模式生效,后发现GetCharWidth()方法计算不准确,就改成通用设置
|
||||
//Business.Impl.LanguageTranslation.Translatable &&
|
||||
if (text.Length > 0)
|
||||
{
|
||||
using (Graphics graphics = label.CreateGraphics())
|
||||
{
|
||||
// 使用TextRenderer而不是Graphics.MeasureString,以匹配Label的文本渲染方式
|
||||
Size textSize = TextRenderer.MeasureText(graphics, text, label.Font);
|
||||
panel.Width= textSize.Width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BaseUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void ModifyDefaultColors(Color color)
|
||||
{
|
||||
DefaultLabelForceColor = color;
|
||||
}
|
||||
|
||||
public void ModifyAuditDefaultColors(Color color)
|
||||
{
|
||||
DefaultLabelForceColor = color;
|
||||
ReadOnlyLabelForceColor = color;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1098,4 +1098,47 @@ namespace Lskj.MiniBlink
|
||||
return InvokeJSW("return document.documentElement.outerHTML").ToString();
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (handle != IntPtr.Zero)
|
||||
{
|
||||
BlinkBrowserPInvoke.wkeLoadHTMLW(this.handle, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Url
|
||||
{
|
||||
get { return url; }
|
||||
set
|
||||
{
|
||||
url = value;
|
||||
if (handle != IntPtr.Zero)
|
||||
{
|
||||
BlinkBrowserPInvoke.wkeLoadURLW(handle, url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Cookies
|
||||
{
|
||||
get
|
||||
{
|
||||
if (handle != IntPtr.Zero)
|
||||
{
|
||||
return BlinkBrowserPInvoke.Utf8IntptrToString(BlinkBrowserPInvoke.wkeGetCookie(handle));
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -124,4 +124,38 @@ namespace Lskj.Control.BrowserSetting
|
||||
{
|
||||
baseForm.Invoke(new Action(() =>
|
||||
{
|
||||
BsOpenModuleHandler.AddReturn
|
||||
BsOpenModuleHandler.AddReturnRow(arg0);
|
||||
if (isclose)
|
||||
{
|
||||
baseForm.DialogResult = DialogResult.OK;
|
||||
baseForm.Close();
|
||||
}
|
||||
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BsOpenModuleHandler.AddReturnRow(arg0);
|
||||
if (isclose)
|
||||
{
|
||||
baseForm.DialogResult = DialogResult.OK;
|
||||
baseForm.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return base.OnProcessMessageReceived(browser, frame, sourceProcess, message);
|
||||
}
|
||||
public void Created(CefBrowser cefBrowser)
|
||||
{
|
||||
if (OnCreated != null)
|
||||
{
|
||||
OnCreated(cefBrowser, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,4 +188,32 @@ namespace Lskj.Control.BrowserSetting
|
||||
//}
|
||||
}
|
||||
/// <summary>
|
||||
/// 通过 CefBrowser 获取所在��
|
||||
/// 通过 CefBrowser 获取所在的 WinForms 窗口
|
||||
/// </summary>
|
||||
public static Form GetParentForm(CefBrowser browser,out string ModuleCode)
|
||||
{
|
||||
ModuleCode = "";
|
||||
try
|
||||
{
|
||||
if (browser == null) return null;
|
||||
IntPtr browserHandle = browser.GetHost().GetWindowHandle();
|
||||
if (browserHandle == IntPtr.Zero) return null;
|
||||
IntPtr parentHandle = GetParent(browserHandle);
|
||||
if (parentHandle == IntPtr.Zero) return null;
|
||||
System.Windows.Forms.Control control = System.Windows.Forms.Control.FromHandle(parentHandle);
|
||||
|
||||
if (control != null && control.Parent != null && control.Parent.Parent != null)
|
||||
{
|
||||
ModuleCode = (control.Parent.Parent).Tag + "";
|
||||
}
|
||||
|
||||
return control as Form;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,27 @@ namespace Lskj.Control.BrowserSetting
|
||||
}
|
||||
break;
|
||||
case 38://↑
|
||||
if (keyEvent.EventT
|
||||
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
|
||||
{
|
||||
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
|
||||
if (ctrlDown && browser.GetHost().GetZoomLevel() < 3)
|
||||
{
|
||||
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() + 0.1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 40://↓
|
||||
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
|
||||
{
|
||||
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
|
||||
if (ctrlDown && browser.GetHost().GetZoomLevel() > -3)
|
||||
{
|
||||
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() - 0.1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,33 @@ namespace Lskj.Control.BrowserSetting
|
||||
}
|
||||
protected override void OnAfterCreated(Xilium.CefGlue.CefBrowser browser)
|
||||
{
|
||||
base.OnAfterCreated(browser
|
||||
base.OnAfterCreated(browser);
|
||||
BsClient.Created(browser);
|
||||
}
|
||||
protected override void OnBeforeClose(CefBrowser browser)
|
||||
{
|
||||
base.OnBeforeClose(browser);
|
||||
}
|
||||
|
||||
protected override bool OnBeforePopup(
|
||||
CefBrowser browser,
|
||||
CefFrame frame,
|
||||
string targetUrl,
|
||||
string targetFrameName,
|
||||
CefWindowOpenDisposition targetDisposition,
|
||||
bool userGesture,
|
||||
CefPopupFeatures popupFeatures,
|
||||
CefWindowInfo windowInfo,
|
||||
ref CefClient client,
|
||||
CefBrowserSettings settings,
|
||||
ref CefDictionaryValue extraInfo,
|
||||
ref bool noJavascriptAccess)
|
||||
{
|
||||
if (BsExternalProtocolHandler.TryHandle(targetUrl))
|
||||
return true;
|
||||
|
||||
return base.OnBeforePopup(browser, frame, targetUrl, targetFrameName, targetDisposition,
|
||||
userGesture, popupFeatures, windowInfo, ref client, settings, ref extraInfo, ref noJavascriptAccess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,4 +323,35 @@ namespace Lskj.Control.BrowserSetting
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(rowdata) && StaticControl.RightMenuGridView != null)
|
||||
{
|
||||
JObject
|
||||
JObject rowObject = JsonConvert.DeserializeObject<JObject>(rowdata);
|
||||
JArray jArray = new JArray();
|
||||
jArray.Add(rowObject);
|
||||
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(jArray));
|
||||
|
||||
|
||||
DataTable gridTable = (StaticControl.RightMenuGridView.GridControl.DataSource as DataTable).TrimDeleteRows();
|
||||
if (gridTable == null) return;
|
||||
|
||||
GridColumnCollection gridColumns = StaticControl.RightMenuGridView.Columns;
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(StaticControl.Comprefix) && dataTable.Columns.Contains("ProductId"))
|
||||
{
|
||||
dataTable.Columns["ProductId"].ColumnName = StaticControl.Comprefix+"ProductId"; // 将ProductId加上前缀
|
||||
}
|
||||
DataRow rowItem = dataTable.Rows[0];
|
||||
StaticControl.ReturnRowLisy.Add(rowItem);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,30 @@ namespace Lskj.Control.BrowserSetting
|
||||
native function OpenModule();
|
||||
return OpenModule(menuId, menuName, dllName, modelFlag, urlParams);
|
||||
};
|
||||
boundObject.OpenOnRightClick = function(arrayItem, rightId,MenuN
|
||||
boundObject.OpenOnRightClick = function(arrayItem, rightId,MenuName,mMenuCode)
|
||||
{
|
||||
native function OpenOnRightClick();
|
||||
return OpenOnRightClick(arrayItem, rightId,MenuName,mMenuCode);
|
||||
};
|
||||
boundObject.CloseWin = function()
|
||||
{
|
||||
native function CloseWin();
|
||||
return CloseWin();
|
||||
};
|
||||
boundObject.SelectPro = function(rowdata,isclose)
|
||||
{
|
||||
native function SelectPro();
|
||||
return SelectPro(rowdata,isclose);
|
||||
};
|
||||
})();
|
||||
";
|
||||
CefRuntime.RegisterExtension("boundObject", extensionCode, bsOpenModuleHandler);
|
||||
base.OnWebKitInitialized();
|
||||
}
|
||||
protected override void OnContextCreated(CefBrowser browser, CefFrame frame, CefV8Context context)
|
||||
{
|
||||
bsOpenModuleHandler.V8Context = context;
|
||||
base.OnContextCreated(browser, frame, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,34 @@ namespace Lskj.Control.BrowserSetting
|
||||
System.Diagnostics.Process.Start(processStartInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show(
|
||||
"打开打印程序失败:" + ex.Message,
|
||||
"提示",
|
||||
System.Windows.Forms.MessageBoxButtons.OK,
|
||||
System.Windows.Forms.MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class BsExternalProtocolResourceRequestHandler : CefResourceRequestHandler
|
||||
{
|
||||
protected override CefCookieAccessFilter GetCookieAccessFilter(CefBrowser browser, CefFrame frame, CefRequest request)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void OnProtocolExecution(CefBrowser browser, CefFrame frame, CefRequest request, ref bool allowOsExecution)
|
||||
{
|
||||
if (BsExternalProtocolHandler.IsPrintProtocol(request.Url))
|
||||
{
|
||||
allowOsExecution = true;
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnProtocolExecution(browser, frame, request, ref allowOsExecution);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,4 +340,28 @@ namespace Lskj.Control.BrowserSetting
|
||||
byteRequest = Encoding.UTF8.GetBytes(builder.ToString());
|
||||
break;
|
||||
}
|
||||
|
||||
httpWebRequest.ContentLength = byteRequest.Length;
|
||||
}
|
||||
Stream stream = httpWebRequest.GetRequestStream();
|
||||
stream.Write(byteRequest, 0, byteRequest.Length);
|
||||
stream.Close();
|
||||
|
||||
httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
|
||||
Stream responseStream = httpWebResponse.GetResponseStream();
|
||||
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
|
||||
result = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
responseStream.Close();
|
||||
cookie = httpWebRequest.CookieContainer;
|
||||
cookieCollection = cookie.GetCookies(new Uri(url));
|
||||
return httpWebResponse;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
cookieCollection = null;
|
||||
result = ex.Message;
|
||||
return httpWebResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,4 +89,34 @@ namespace Lskj.Control.BrowserSetting2
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserSetting.BsOpenModuleHandler.OpenRightModule(arg0, ar
|
||||
BrowserSetting.BsOpenModuleHandler.OpenRightModule(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
}
|
||||
else if (message.Name.Equals("CloseWin"))
|
||||
{
|
||||
if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm)
|
||||
{
|
||||
if (baseForm.InvokeRequired)
|
||||
{
|
||||
baseForm.Invoke(new Action(() =>
|
||||
{
|
||||
baseForm.Close();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
baseForm.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
return base.OnProcessMessageReceived(browser, frame, sourceProcess, message);
|
||||
}
|
||||
public void Created(CefBrowser cefBrowser)
|
||||
{
|
||||
if (OnCreated != null)
|
||||
{
|
||||
OnCreated(cefBrowser, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,4 +77,27 @@ namespace Lskj.Control.BrowserSetting2
|
||||
}
|
||||
break;
|
||||
case 38://↑
|
||||
if (keyEvent.EventT
|
||||
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
|
||||
{
|
||||
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
|
||||
if (ctrlDown && browser.GetHost().GetZoomLevel() < 3)
|
||||
{
|
||||
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() + 0.1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 40://↓
|
||||
if (keyEvent.EventType.Equals(CefKeyEventType.RawKeyDown))
|
||||
{
|
||||
bool ctrlDown = (keyEvent.Modifiers & CefEventFlags.ControlDown) != 0;
|
||||
if (ctrlDown && browser.GetHost().GetZoomLevel() > -3)
|
||||
{
|
||||
browser.GetHost().SetZoomLevel(browser.GetHost().GetZoomLevel() - 0.1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
-1
@@ -131,4 +131,24 @@
|
||||
this.pl_buttom.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_main)).EndInit();
|
||||
this.pl_main.ResumeLayout(false);
|
||||
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMain)).EndInit();
|
||||
this.splitMain.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pointSeriesLabel1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cmMain)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl pl_buttom;
|
||||
private DevExpress.XtraEditors.PanelControl pl_main;
|
||||
private GridControlEx gridControlEx1;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMain;
|
||||
public DevExpress.XtraCharts.ChartControl cmMain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,4 +601,45 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// The y axis shared
|
||||
/// </summary>
|
||||
public int YAxisShar
|
||||
public int YAxisShared;
|
||||
/// <summary>
|
||||
/// The y axis title
|
||||
/// </summary>
|
||||
public string YAxisTitle;
|
||||
/// <summary>
|
||||
/// The x label field
|
||||
/// </summary>
|
||||
public string XLabelField;
|
||||
/// <summary>
|
||||
/// The y value field
|
||||
/// </summary>
|
||||
public string YValueField;
|
||||
/// <summary>
|
||||
/// The chart color
|
||||
/// </summary>
|
||||
public string ChartColor;
|
||||
/// <summary>
|
||||
/// The chart type
|
||||
/// </summary>
|
||||
public ChartType ChartType;
|
||||
/// <summary>
|
||||
/// 是否为百分比
|
||||
/// </summary>
|
||||
public string IsAbsolutely;
|
||||
/// <summary>
|
||||
/// Y轴最大刻度
|
||||
/// </summary>
|
||||
public double YScale;
|
||||
|
||||
/// <summary>
|
||||
/// 禁显数字
|
||||
/// </summary>
|
||||
public bool ValueVisible;
|
||||
/// <summary>
|
||||
/// 图表标题
|
||||
/// </summary>
|
||||
public string ChartTitle;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+36
-1
@@ -1 +1,36 @@
|
||||
namespace Lskj.Cont
|
||||
namespace Lskj.Control
|
||||
{
|
||||
partial class CircleButton
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,4 +131,39 @@ namespace Lskj.Control
|
||||
private void SyncSize()
|
||||
{
|
||||
Width = Height = _radius * 2;
|
||||
|
||||
UpdateRegion();
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
private void UpdateRegion()
|
||||
{
|
||||
try
|
||||
{
|
||||
GraphicsPath gp = new GraphicsPath();
|
||||
gp.AddEllipse(0, 0, Width, Height);
|
||||
Region?.Dispose();
|
||||
Region = new Region(gp);
|
||||
}
|
||||
catch (Exception ex) { Debug.WriteLine(ex); }
|
||||
}
|
||||
|
||||
/* 隐藏 Size(设计器防误改) */
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new Size Size
|
||||
{
|
||||
get => base.Size;
|
||||
set => base.Size = value;
|
||||
}
|
||||
public void SetMenuNum(int num)
|
||||
{
|
||||
if (SystemInfo.Instance.DisableShowNotify || num < 1)
|
||||
{
|
||||
this.Visible = false;
|
||||
return;
|
||||
}
|
||||
this.Number = num;
|
||||
this.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+26
-1
@@ -36,4 +36,29 @@ namespace Lskj.Control
|
||||
// txtEdit
|
||||
//
|
||||
this.txtEdit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtEdit.Loca
|
||||
this.txtEdit.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtEdit.Name = "txtEdit";
|
||||
this.txtEdit.Size = new System.Drawing.Size(800, 450);
|
||||
this.txtEdit.TabIndex = 1;
|
||||
//
|
||||
// FrmAnnouncement
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.txtEdit);
|
||||
this.Name = "FrmAnnouncement";
|
||||
this.Text = "公告";
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.MemoEdit txtEdit;
|
||||
}
|
||||
}
|
||||
@@ -124,4 +124,32 @@ namespace Lskj.Control
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show("选择�
|
||||
MessageUtil.Show("选择反退步骤确定操作出错!" + Message);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:取消操作/para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-01-23</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
try {
|
||||
if (BtnCancelCallBack != null) BtnCancelCallBack(sender, e);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-1
@@ -283,4 +283,23 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lab
|
||||
private System.Windows.Forms.Label lable1;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl5;
|
||||
private System.Windows.Forms.Label lblFP;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl3;
|
||||
private GridControlEx gcMain;
|
||||
private System.Windows.Forms.Label lblTotal;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl2;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl6;
|
||||
private System.Windows.Forms.Label lblSY;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl4;
|
||||
private DevExpress.XtraEditors.SimpleButton btnCancel;
|
||||
private DevExpress.XtraEditors.SimpleButton btnFP;
|
||||
private DevExpress.XtraEditors.PanelControl PlSearch;
|
||||
private DevExpress.XtraEditors.SimpleButton btnJ;
|
||||
private DevExpress.XtraEditors.SimpleButton btnDel;
|
||||
private DevExpress.XtraEditors.SimpleButton btnUpdate;
|
||||
}
|
||||
}
|
||||
@@ -567,4 +567,30 @@ namespace Lskj.Control
|
||||
/// <para>说明:行颜色</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs"/> instance containing the event data.</param>
|
||||
void GridView_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataRow rowItem = this.gcMain.GridView.GetDataRow(e.RowHandle);
|
||||
|
||||
double total = Convert.ToDouble(rowItem[KcAmountField]);
|
||||
double fpAmount = Convert.ToDouble(rowItem[AmountField]);
|
||||
|
||||
if (fpAmount > 0)
|
||||
{
|
||||
e.Appearance.BackColor = total - fpAmount <= 0 ? Color.Green : Color.Red;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+26
-1
@@ -38,4 +38,29 @@ namespace Lskj.Control
|
||||
this.gridcolor.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridcolor.Location = new System.Drawing.Point(0, 0);
|
||||
this.gridcolor.Margin = new System.Windows.Forms.Padding(4);
|
||||
|
||||
this.gridcolor.Name = "gridcolor";
|
||||
this.gridcolor.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gridcolor.Size = new System.Drawing.Size(800, 450);
|
||||
this.gridcolor.SysModel = null;
|
||||
this.gridcolor.TabIndex = 8;
|
||||
//
|
||||
// FrmColorDescription
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.gridcolor);
|
||||
this.Name = "FrmColorDescription";
|
||||
this.Text = "颜色说明";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private GridControlEx gridcolor;
|
||||
}
|
||||
}
|
||||
@@ -88,4 +88,32 @@ namespace Lskj.Control
|
||||
//ifStrickOutColumn.Visible = true;
|
||||
//ifStrickOutColumn.VisibleIndex = 10;
|
||||
|
||||
//GridColumn ii
|
||||
//GridColumn iifUnderLineColumn = new GridColumn();
|
||||
//iifUnderLineColumn.Caption = "下划线";
|
||||
//iifUnderLineColumn.FieldName = "ifUnderLine";
|
||||
//iifUnderLineColumn.ColumnEdit = checkEdit;
|
||||
//iifUnderLineColumn.Visible = true;
|
||||
//iifUnderLineColumn.VisibleIndex = 11;
|
||||
|
||||
//GridColumn useflagColumn = new GridColumn();
|
||||
//useflagColumn.Caption = "禁用";
|
||||
//useflagColumn.FieldName = "useflag";
|
||||
//useflagColumn.ColumnEdit = checkEdit;
|
||||
//useflagColumn.Visible = true;
|
||||
//useflagColumn.VisibleIndex = 12;
|
||||
|
||||
this.gridcolor.GridView.Columns.AddRange(new GridColumn[] {
|
||||
conditionColumn,
|
||||
forcecolorColumn,
|
||||
backcolorColumn,
|
||||
//ifBoldColumn,
|
||||
//ifItalicColumn,
|
||||
//ifStrickOutColumn,
|
||||
//iifUnderLineColumn,
|
||||
//useflagColumn
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,4 +205,41 @@ namespace Lskj.Control
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Messag
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton24_Click(object sender, EventArgs e)
|
||||
{
|
||||
try {
|
||||
if (this.mPage < this.mMaxPage)
|
||||
{
|
||||
this.mPage += 1;
|
||||
this.InitControl();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton25_Click(object sender, EventArgs e)
|
||||
{
|
||||
try {
|
||||
if (this.mPage == this.mMaxPage) return;
|
||||
this.mPage = this.mMaxPage;
|
||||
this.InitControl();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,4 +213,41 @@ namespace Lskj.Control
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Messa
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton24_Click(object sender, EventArgs e)
|
||||
{
|
||||
try {
|
||||
if (this.mPage < this.mMaxPage)
|
||||
{
|
||||
this.mPage += 1;
|
||||
this.InitControl();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton25_Click(object sender, EventArgs e)
|
||||
{
|
||||
try {
|
||||
if (this.mPage == this.mMaxPage) return;
|
||||
this.mPage = this.mMaxPage;
|
||||
this.InitControl();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+26
-1
@@ -112,4 +112,29 @@
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(751, 542);
|
||||
this.Controls.Add(this.gcMain);
|
||||
this.Controls.Add(this.pl_bottom);
|
||||
this.Controls.Add(this.pl_top);
|
||||
this.Name = "FrmCover";
|
||||
this.Text = "导入Excel";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_top)).EndInit();
|
||||
this.pl_top.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).EndInit();
|
||||
this.pl_bottom.ResumeLayout(false);
|
||||
this.pl_bottom.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl pl_top;
|
||||
private DevExpress.XtraEditors.SimpleButton btnCover;
|
||||
private DevExpress.XtraEditors.SimpleButton btnRead;
|
||||
private DevExpress.XtraEditors.PanelControl pl_bottom;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private Control.GridControlEx gcMain;
|
||||
}
|
||||
}
|
||||
@@ -1066,3 +1066,34 @@ namespace Lskj.Control
|
||||
string[] fields = model.UnionFields.Trim(',').Split(',');
|
||||
DataRow rowResult = BaseImpl.GetDataRowResult(unionValues);
|
||||
if (rowResult != null)
|
||||
{
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
string field = fields[i];
|
||||
string value = rowResult.Table.Columns.Contains(field) ? rowResult[field] + "" : null;
|
||||
rowItem[field] = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 设置为空
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
string field = fields[i];
|
||||
rowItem[field] = DBNull.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
LogUtil.WriteError("计算列关联字段--错误-->" + unionValues, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -346,4 +346,30 @@ namespace Lskj.Control
|
||||
/// <para>说明:取消</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <par
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void OnCancel(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isFinished && DialogResult.Yes == MessageBox.Show("附件正在下载确定取消下载吗?", ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
|
||||
{
|
||||
evtDownload.Set();
|
||||
evtPerDonwload.Set();
|
||||
Exit(false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show("附件下载取消出错!" + Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1035,4 +1035,36 @@ namespace Lskj.Control
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版�
|
||||
/// <para>版本:1.0.0.3</para>
|
||||
/// </summary>
|
||||
/// <param name="control">The control.</param>
|
||||
/// <returns>DataTable.</returns>
|
||||
public string GetValueByImportText(GridColumnModel model, string text, bool isBillImport = false)
|
||||
{
|
||||
string value = text;
|
||||
|
||||
Dictionary<string, string> translationDict = null;
|
||||
if (ValueGridColumnTable.TryGetValue(model, out translationDict))
|
||||
{
|
||||
if (translationDict != null && translationDict.Count > 0)
|
||||
{
|
||||
if (translationDict.TryGetValue(text, out string translatedValue))
|
||||
{
|
||||
value = translatedValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,4 +288,38 @@ namespace Lskj.Control
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.mPage == this.mMaxPage) return;
|
||||
if (this.mPage == this.mMaxPage) return;
|
||||
this.mPage = this.mMaxPage;
|
||||
this.InitControl();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton5_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.ShowText = this.ShowText.TrimStart(',');
|
||||
this.ShowValue = this.ShowValue.TrimStart(',');
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton6_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+26
-1
@@ -173,4 +173,29 @@
|
||||
this.Text = "导入Excel";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnImportFormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_top)).EndInit();
|
||||
this.pl_top.ResumeLayout(false
|
||||
this.pl_top.ResumeLayout(false);
|
||||
this.pl_top.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).EndInit();
|
||||
this.pl_bottom.ResumeLayout(false);
|
||||
this.pl_bottom.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_main)).EndInit();
|
||||
this.pl_main.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl pl_top;
|
||||
private DevExpress.XtraEditors.PanelControl pl_bottom;
|
||||
private DevExpress.XtraEditors.PanelControl pl_main;
|
||||
private DevExpress.XtraEditors.SimpleButton btnExport;
|
||||
private DevExpress.XtraEditors.SimpleButton btnImport;
|
||||
private DevExpress.XtraEditors.SimpleButton btnRead;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private GridControlEx gcMain;
|
||||
private DevExpress.XtraEditors.SimpleButton btnCover;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1281,3 +1281,34 @@ namespace Lskj.Control
|
||||
string[] fields = model.UnionFields.Trim(',').Split(',');
|
||||
DataRow rowResult = BaseImpl.GetDataRowResult(unionValues);
|
||||
if (rowResult != null)
|
||||
{
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
string field = fields[i];
|
||||
string value = rowResult.Table.Columns.Contains(field) ? rowResult[field] + "" : null;
|
||||
rowItem[field] = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 设置为空
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
string field = fields[i];
|
||||
rowItem[field] = DBNull.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
LogUtil.WriteError("计算列关联字段--错误-->" + unionValues, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Generated
+24
-1
@@ -67,4 +67,27 @@ namespace Lskj.Control
|
||||
//
|
||||
// FrmPicture
|
||||
//
|
||||
this.Appearance.Back
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(787, 571);
|
||||
this.Controls.Add(this.lbRight);
|
||||
this.Controls.Add(this.lbLeft);
|
||||
this.Controls.Add(this.pictureEdit);
|
||||
this.Name = "FrmPicture";
|
||||
this.Text = "FrmPicture";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureEdit.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PictureEdit pictureEdit;
|
||||
private System.Windows.Forms.Label lbLeft;
|
||||
private System.Windows.Forms.Label lbRight;
|
||||
}
|
||||
}
|
||||
@@ -71,4 +71,25 @@ namespace Lskj.Control
|
||||
if (index >= 0 && index - 1 >= 0)
|
||||
{
|
||||
FocusedColumn = PicUrlColumns[index - 1];
|
||||
|
||||
if (FocusedColumn.Tag != null && FocusedColumn.Tag is GridColumnModel columnModel)
|
||||
{
|
||||
string imageUrl = FocusedRow.Table.Columns.Contains(columnModel.FieldName) ? FocusedRow[columnModel.FieldName] + "" : "";
|
||||
if (string.IsNullOrEmpty(imageUrl))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!imageUrl.StartsWith("http"))
|
||||
{
|
||||
string oaUrl = SystemInfo.Instance.OAUrl.EndsWith("/") ? SystemInfo.Instance.OAUrl : $"{SystemInfo.Instance.OAUrl}/";
|
||||
imageUrl = $"{oaUrl}{imageUrl}";
|
||||
}
|
||||
if (columnModel.LabPicUrlImages.ContainsKey(imageUrl))
|
||||
{
|
||||
Image image = ((KeyValuePair<Image, Image>)columnModel.LabPicUrlImages[imageUrl]).Key;
|
||||
Picture = image;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+25
-1
@@ -79,4 +79,28 @@ namespace Lskj.Control
|
||||
this.gridView.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView.OptionsView.RowAutoHeight = true;
|
||||
this.gridView.OptionsView.ShowGroupPanel = false;
|
||||
this.gridView.PaintStyleNam
|
||||
this.gridView.PaintStyleName = "Skin";
|
||||
//
|
||||
// FrmPositioningColumn
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(535, 309);
|
||||
this.Controls.Add(this.gridControl);
|
||||
this.Name = "FrmPositioningColumn";
|
||||
this.Text = "双击定位到选中列";
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public DevExpress.XtraGrid.GridControl gridControl;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
|
||||
}
|
||||
}
|
||||
@@ -62,4 +62,35 @@ namespace Lskj.Control
|
||||
Caption,
|
||||
});
|
||||
|
||||
// 初始��
|
||||
// 初始化DataTable
|
||||
if (this.ColumnInformation.Count > 0)
|
||||
{
|
||||
DataTable dataTable = new DataTable();
|
||||
dataTable.Columns.Add("Caption", typeof(string));
|
||||
dataTable.Columns.Add("FieldName", typeof(string));
|
||||
|
||||
|
||||
foreach (string item in ColumnInformation.Keys)
|
||||
{
|
||||
string value = ColumnInformation[item];
|
||||
dataTable.Rows.Add(value, item);
|
||||
}
|
||||
this.gridControl.DataSource = dataTable;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void GridView_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
this.FindName = string.Empty;
|
||||
DataRow rowItem = this.gridView.GetFocusedDataRow();
|
||||
if (rowItem != null)
|
||||
{
|
||||
this.FindName = rowItem["FieldName"] + "";
|
||||
this.Close();
|
||||
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+22
-1
@@ -215,4 +215,25 @@ namespace Lskj.Control
|
||||
((System.ComponentModel.ISupportInitialize)(this.pltopmain)).EndInit();
|
||||
this.pltopmain.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_mainSearch)).EndInit();
|
||||
this.pl_
|
||||
this.pl_mainSearch.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_search)).EndInit();
|
||||
this.flowLayoutPanel.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private DevExpress.XtraEditors.PanelControl pl_main;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMainControl;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitLeftControl;
|
||||
private Control.ModuleGridEx gcRight;
|
||||
private DevExpress.XtraEditors.PanelControl pl_mainSearch;
|
||||
private DevExpress.XtraEditors.PanelControl pl_search;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
|
||||
private DevExpress.XtraEditors.SimpleButton btnSave;
|
||||
private DevExpress.XtraEditors.PanelControl pltopmain;
|
||||
private Control.BandedGridControlEx bandGcTop;
|
||||
private Control.TreeBandedGridControlEx treebandGcTop;
|
||||
private Control.TabControlEx tabBottom;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2633,4 +2633,27 @@ namespace Lskj.Control
|
||||
public List<TreeListNode> treeListNodes = new List<TreeListNode>();
|
||||
// 在你的类内部定义此字典(一次定义,长期复用)
|
||||
public Dictionary<object, DateTime> columnDateMapping = new Dictionary<object, DateTime>();
|
||||
pub
|
||||
public Dictionary<string, HashSet<string>> nonEditableCells = new Dictionary<string, HashSet<string>>();
|
||||
public DynamicModel TopSysModel;
|
||||
public ModuleModel TopModuleModel;
|
||||
public DataTable TopGridColumns;
|
||||
public DataTable TopRightMenus;
|
||||
public DataTable TopRowColors;
|
||||
public DataTable TopSearchTab;
|
||||
public MyControl TopSearchObj;
|
||||
public DataTable TopSchemesTable;
|
||||
public GridDetailModel BottomDetailModel;
|
||||
public DynamicModel BottomSysModel;
|
||||
public ModuleModel BottomModuleModel;
|
||||
public DataTable BottomGridColumns;
|
||||
public DataTable BottomRightMenus;
|
||||
public DataTable BottomRowColors;
|
||||
public GridDetailModel RightDetailModel;
|
||||
public DynamicModel RightSysModel;
|
||||
public ModuleModel RightModuleModel;
|
||||
public DataTable RightGridColumns;
|
||||
public DataTable RightRightMenus;
|
||||
public DataTable RightRowColors;
|
||||
public int MainLeftCoord;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,4 +326,35 @@ namespace Lskj.Control
|
||||
}
|
||||
if (string.IsNullOrEmpty(FileName))
|
||||
{
|
||||
MessageUtil.Show("请填写下载的文件名��
|
||||
MessageUtil.Show("请填写下载的文件名称!");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(DownloadPath))
|
||||
{
|
||||
MessageUtil.Show("请选择下载路径!");
|
||||
return;
|
||||
}
|
||||
FrmDownload frm = new FrmDownload(URL, FileName, DownloadPath);
|
||||
frm.RightDisplay = RightDisplay;
|
||||
|
||||
if (frm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
frm.Dispose();
|
||||
if (isBatchDownLoad)
|
||||
{
|
||||
PrintFile(labAddress.EditText);
|
||||
File.Delete(labAddress.EditText);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Close();
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show("下载附件出错!" + Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+25
-1
@@ -88,4 +88,28 @@ namespace Lskj.Control
|
||||
//
|
||||
// FrmSettingTableName
|
||||
//
|
||||
this.Appearan
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(288, 92);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.labelAutoTextEdit1);
|
||||
this.Name = "FrmSettingTableName";
|
||||
this.Text = "请输入工作表名称";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private LabelAutoTextEdit labelAutoTextEdit1;
|
||||
private DevExpress.XtraEditors.SimpleButton btnOk;
|
||||
private DevExpress.XtraEditors.SimpleButton btnCancel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
@@ -27,4 +27,35 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化窗
|
||||
/// 初始化窗体按钮事件。
|
||||
/// </summary>
|
||||
private void InitEvent()
|
||||
{
|
||||
this.btnOk.Click += btnOk_Click;
|
||||
this.btnCancel.Click += btnCancel_Click;
|
||||
this.FormBorderStyle = FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击确定时,保存用户输入的工作表名称,并通知调用方用户已确认。
|
||||
/// </summary>
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.TabName = this.labelAutoTextEdit1.EditText.Trim();
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击取消时,通知调用方用户已取消。
|
||||
/// </summary>
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,4 +609,36 @@ namespace Lskj.Control
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本
|
||||
/// <para>版本:1.0.0.3</para>
|
||||
/// </summary>
|
||||
/// <param name="control">The control.</param>
|
||||
/// <returns>DataTable.</returns>
|
||||
public string GetValueByImportText(GridColumnModel model, string text, bool isBillImport = false)
|
||||
{
|
||||
string value = text;
|
||||
|
||||
Dictionary<string, string> translationDict = null;
|
||||
if (ValueGridColumnTable.TryGetValue(model, out translationDict))
|
||||
{
|
||||
if (translationDict != null && translationDict.Count > 0)
|
||||
{
|
||||
if (translationDict.TryGetValue(text, out string translatedValue))
|
||||
{
|
||||
value = translatedValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+24
-1
@@ -67,4 +67,27 @@ namespace Lskj.Control
|
||||
//
|
||||
// FrmTreePicture
|
||||
//
|
||||
this.Appearance.BackColor =
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(787, 571);
|
||||
this.Controls.Add(this.lbRight);
|
||||
this.Controls.Add(this.lbLeft);
|
||||
this.Controls.Add(this.pictureEdit);
|
||||
this.Name = "FrmTreePicture";
|
||||
this.Text = "FrmTreePicture";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureEdit.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PictureEdit pictureEdit;
|
||||
private System.Windows.Forms.Label lbLeft;
|
||||
private System.Windows.Forms.Label lbRight;
|
||||
}
|
||||
}
|
||||
@@ -84,4 +84,30 @@ namespace Lskj.Control
|
||||
if (FocusedColumn.Tag != null && FocusedColumn.Tag is GridColumnModel columnModel)
|
||||
{
|
||||
// 读取图片URL(同右侧逻辑,兼容 TreeList 数据行)
|
||||
string imageUrl = FocusedRow.Table.Columns.Contains(columnModel.FieldName)
|
||||
string imageUrl = FocusedRow.Table.Columns.Contains(columnModel.FieldName)
|
||||
? FocusedRow[columnModel.FieldName] + ""
|
||||
: "";
|
||||
|
||||
if (string.IsNullOrEmpty(imageUrl))
|
||||
return;
|
||||
|
||||
// 补全URL(保持原有逻辑)
|
||||
if (!imageUrl.StartsWith("http"))
|
||||
{
|
||||
string oaUrl = SystemInfo.Instance.OAUrl.EndsWith("/")
|
||||
? SystemInfo.Instance.OAUrl
|
||||
: $"{SystemInfo.Instance.OAUrl}/";
|
||||
imageUrl = $"{oaUrl}{imageUrl}";
|
||||
}
|
||||
|
||||
// 从列模型缓存中获取图片(保持原有逻辑)
|
||||
if (columnModel.LabPicUrlImages.ContainsKey(imageUrl))
|
||||
{
|
||||
Image image = ((KeyValuePair<Image, Image>)columnModel.LabPicUrlImages[imageUrl]).Key;
|
||||
Picture = image;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,4 +148,22 @@ namespace Lskj.Control
|
||||
qpLS.Add(string.Format("{0}={1}", eqParams[0], HttpUtility.UrlEncode(HttpUtility.UrlDecode(string.Join("=", eqParams.Skip(1)))).Replace("%5c", "/").Replace("%2f", "/").Replace("//", "/").Replace("+", "%20")));
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
if (pms.Count > 0)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now.AddDays(1);
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond;
|
||||
pms.Add("exp", timestamp);
|
||||
}
|
||||
if(url.Contains("pms=")) return $"{urlParams[0]}?{HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
|
||||
|
||||
return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,4 +155,22 @@ namespace Lskj.Control
|
||||
{
|
||||
DateTime dateTime = DateTime.Now.AddDays(1);
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond;
|
||||
pms.Add("exp", timestamp);
|
||||
}
|
||||
var allowToEnUrl = qpLS.Where(n => n.Equals("ToEnUrl=0", StringComparison.OrdinalIgnoreCase)).FirstOrDefault() != null;
|
||||
if (allowToEnUrl)
|
||||
{
|
||||
return url;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (url.Contains("pms=")) return $"{urlParams[0]}?{HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
|
||||
|
||||
return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
-1
@@ -146,4 +146,26 @@
|
||||
this.Controls.Add(this.pl_main);
|
||||
this.Controls.Add(this.pl_buttom);
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
|
||||
this.Name = "GridControlEx";
|
||||
this.Size = new System.Drawing.Size(825, 412);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_buttom)).EndInit();
|
||||
this.pl_buttom.ResumeLayout(false);
|
||||
this.pl_buttom.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_main)).EndInit();
|
||||
this.pl_main.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl pl_main;
|
||||
protected System.Windows.Forms.Label lblTotal;
|
||||
public DevExpress.XtraGrid.GridControl gridControl;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
|
||||
private System.Windows.Forms.Panel panelControl1;
|
||||
public DevExpress.XtraEditors.PanelControl pl_buttom;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10449,4 +10449,31 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void GridView_MouseWhee
|
||||
private void GridView_MouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
HandledMouseEventArgs handledArgs = e as HandledMouseEventArgs;
|
||||
if (handledArgs != null)
|
||||
{
|
||||
handledArgs.Handled = false; // 放行事件,允许系统处理Shift+滚轮
|
||||
}
|
||||
if ((ModifierKeys & Keys.Shift) == Keys.Shift)
|
||||
{
|
||||
// 滚轮方向判断
|
||||
int scrollStep = e.Delta > 0 ? -20 : 20; // 滚动步长,可调整(建议10-30)
|
||||
// 计算滚动条位置
|
||||
int newLeftCoord = gridView.LeftCoord + scrollStep;
|
||||
newLeftCoord = Math.Max(0, newLeftCoord);//Math.Min(newLeftCoord, maxLeftCoord)
|
||||
// 移动滚动条位置
|
||||
gridView.LeftCoord = newLeftCoord;
|
||||
|
||||
if (handledArgs != null)
|
||||
{
|
||||
handledArgs.Handled = true;// 阻止默认垂直滚动
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+27
-1
@@ -98,4 +98,30 @@ namespace Lskj.Control
|
||||
this.btnMore.Name = "btnMore";
|
||||
this.btnMore.Size = new System.Drawing.Size(26, 21);
|
||||
this.btnMore.TabIndex = 2;
|
||||
|
||||
//
|
||||
// LabApiButtonEdit
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.plRight);
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabApiButtonEdit";
|
||||
this.Size = new System.Drawing.Size(164, 21);
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.plRight.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.Panel plRight;
|
||||
private DevExpress.XtraEditors.TextEdit txtEdit;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private DevExpress.XtraEditors.SimpleButton btnMore;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,225 +1,263 @@
|
||||
using DevExpress.XtraEditors;
|
||||
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 Lskj.Control
|
||||
{
|
||||
public partial class LabApiButtonEdit : BaseUserControl
|
||||
{
|
||||
public LabApiButtonEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
txtEdit.ReadOnly = true;
|
||||
btnMore.Click += OnBtnMoreClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
public event EventHandler OnRefreshDataCallBack;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtEdit;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
|
||||
this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击按钮重新获取数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnMoreClick(object sender, EventArgs e)
|
||||
{
|
||||
if (OnRefreshDataCallBack != null)
|
||||
{
|
||||
OnRefreshDataCallBack(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
using DevExpress.XtraEditors;
|
||||
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 Lskj.Control
|
||||
{
|
||||
public partial class LabApiButtonEdit : BaseUserControl
|
||||
{
|
||||
public LabApiButtonEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
txtEdit.ReadOnly = true;
|
||||
btnMore.Click += OnBtnMoreClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
public event EventHandler OnRefreshDataCallBack;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtEdit;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
|
||||
this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击按钮重新获取数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnMoreClick(object sender, EventArgs e)
|
||||
{
|
||||
if (OnRefreshDataCallBack != null)
|
||||
{
|
||||
OnRefreshDataCallBack(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -855,4 +855,42 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+28
-1
@@ -86,4 +86,31 @@
|
||||
this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.plLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.plLeft.Name = "plLeft";
|
||||
this.plLeft.Size = new System.Drawing.Size(40, 21)
|
||||
this.plLeft.Size = new System.Drawing.Size(40, 21);
|
||||
this.plLeft.TabIndex = 2;
|
||||
//
|
||||
// LabelAutoTextEdit
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.plRight);
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabelAutoTextEdit";
|
||||
this.Size = new System.Drawing.Size(162, 21);
|
||||
this.plRight.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel plRight;
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private DevExpress.XtraEditors.SimpleButton btnRefresh;
|
||||
private AutoGridLookUp txtEdit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,4 +397,43 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -338,4 +338,42 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -242,4 +242,30 @@ namespace Lskj.Control
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">The data source.</param>
|
||||
public void SetDataSource(DataTable dataSource)
|
||||
{
|
||||
this.dataTable = dataSource;
|
||||
this.txtEdit.DataSource = dataSource;
|
||||
this.txtEdit.DataSourceTable = dataSource.Copy();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:打开界面</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2021-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnMoreClick(object sender, EventArgs e)
|
||||
{
|
||||
this.txtEdit.OnAutoPopupShow();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+26
-1
@@ -101,4 +101,29 @@ namespace Lskj.Control
|
||||
//
|
||||
// LabelAutoLookUpEdit
|
||||
//
|
||||
this.AutoScaleMode =
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.plRight);
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabelAutoLookUpEdit";
|
||||
this.Size = new System.Drawing.Size(162, 21);
|
||||
this.plRight.ResumeLayout(false);
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.Panel plRight;
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private DevExpress.XtraEditors.SimpleButton btnMore;
|
||||
private AutoGridLookUp txtEdit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,4 +304,42 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+28
-1
@@ -86,4 +86,31 @@ namespace Lskj.Control
|
||||
this.btnSource.Location = new System.Drawing.Point(91, 0);
|
||||
this.btnSource.Name = "btnSource";
|
||||
this.btnSource.Size = new System.Drawing.Size(28, 20);
|
||||
this.btnSource.TabIndex = 3
|
||||
this.btnSource.TabIndex = 37;
|
||||
this.btnSource.Text = "...";
|
||||
this.btnSource.Visible = false;
|
||||
//
|
||||
// LabelBillSourceComboxEdit
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.plRight);
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabelBillSourceComboxEdit";
|
||||
this.Size = new System.Drawing.Size(158, 20);
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.plRight.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.Panel plRight;
|
||||
private DevExpress.XtraEditors.SimpleButton btnSource;
|
||||
private AutoGridLookUp txtEdit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,4 +387,41 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,224 +1,262 @@
|
||||
/******************************
|
||||
* 说明:自定义网站控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Data;
|
||||
using System.Diagnostics;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义网站控件
|
||||
/// </summary>
|
||||
public partial class LabelBrowserEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelBrowserEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void picBrowser_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
PictureBox pic = (PictureBox)sender;
|
||||
string url = EditText;
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.BrowserTip);
|
||||
return;
|
||||
}
|
||||
Process.Start("iexplore.exe", url);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
/******************************
|
||||
* 说明:自定义网站控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Data;
|
||||
using System.Diagnostics;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义网站控件
|
||||
/// </summary>
|
||||
public partial class LabelBrowserEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelBrowserEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void picBrowser_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
PictureBox pic = (PictureBox)sender;
|
||||
string url = EditText;
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.BrowserTip);
|
||||
return;
|
||||
}
|
||||
Process.Start("iexplore.exe", url);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,4 +188,41 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,4 +198,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,4 +181,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,4 +155,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+166
-128
@@ -1,128 +1,166 @@
|
||||
/******************************
|
||||
* 说明:自定义复选文本控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 复选文本控件
|
||||
/// </summary>
|
||||
public partial class LabelCheckEdit : BaseUserControl
|
||||
{
|
||||
public CheckEdit TextEdit { get { return this.checkEdt; } }
|
||||
|
||||
public LabelCheckEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <value>The label text.</value>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checkEdt.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.checkEdt.Text = value;
|
||||
this.Width = checkEdt.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(checkEdt.EditValue + "") ? "0" : checkEdt.EditValue.ToString().ToLower() == "true" ? "1" : "0";
|
||||
}
|
||||
set
|
||||
{
|
||||
string val = string.IsNullOrWhiteSpace(value) || "0".Equals(value) || "false".Equals(value, StringComparison.OrdinalIgnoreCase) ? "0" : "1";
|
||||
this.checkEdt.EditValue = Convert.ToBoolean(Convert.ToInt32(val));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.checkEdt.Properties.ReadOnly = value;
|
||||
this.checkEdt.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.checkEdt.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
/******************************
|
||||
* 说明:自定义复选文本控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 复选文本控件
|
||||
/// </summary>
|
||||
public partial class LabelCheckEdit : BaseUserControl
|
||||
{
|
||||
public CheckEdit TextEdit { get { return this.checkEdt; } }
|
||||
|
||||
public LabelCheckEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <value>The label text.</value>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checkEdt.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.checkEdt.Text = value;
|
||||
this.Width = checkEdt.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(checkEdt.EditValue + "") ? "0" : checkEdt.EditValue.ToString().ToLower() == "true" ? "1" : "0";
|
||||
}
|
||||
set
|
||||
{
|
||||
string val = string.IsNullOrWhiteSpace(value) || "0".Equals(value) || "false".Equals(value, StringComparison.OrdinalIgnoreCase) ? "0" : "1";
|
||||
this.checkEdt.EditValue = Convert.ToBoolean(Convert.ToInt32(val));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.checkEdt.Properties.ReadOnly = value;
|
||||
this.checkEdt.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.checkEdt.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,4 +186,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,4 +181,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,4 +306,45 @@ namespace Lskj.Control
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Propert
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
class ComboBoxModel
|
||||
{
|
||||
public string ValueMember;
|
||||
public string DisplayMember;
|
||||
public DataRow RowItem;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.RowItem[DisplayMember] + "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -269,4 +269,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,4 +312,42 @@ namespace Lskj.Control
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -243,4 +243,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,4 +211,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,380 +1,418 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
public partial class LabelGridSelectEdit : BaseUserControl
|
||||
{
|
||||
private string editValue;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable table = new DataTable();
|
||||
public LabelGridSelectEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (Business.Impl.LanguageTranslation.Translatable)
|
||||
{
|
||||
simpleButton1.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton1.Text);
|
||||
simpleButton4.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton4.Text);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string EditValue
|
||||
{
|
||||
get
|
||||
{
|
||||
BaseUserControl control = null;
|
||||
if (this.Model != null) control = ControlObj.FindControl(this.Model.FieldName);
|
||||
if (this.Model != null && (this.Model.FieldType == ControlType.LabGridPopupValue || this.Model.FieldType == ControlType.LabGridPopupMutilValue))
|
||||
{
|
||||
this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql));
|
||||
if (!string.IsNullOrEmpty(editValue))
|
||||
{
|
||||
return editValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 存在名称并且没有value值则
|
||||
if (control != null && !string.IsNullOrEmpty(control.EditText))
|
||||
{
|
||||
if (table != null && table is DataTable)
|
||||
{
|
||||
String[] strRating = control.EditText.Split(',');
|
||||
string textEditValue = string.Empty;
|
||||
string textEditText = string.Empty;
|
||||
foreach (string strrating in strRating)
|
||||
{
|
||||
DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + "");
|
||||
DataRow rowValueItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
textEditText += rowItem[this.Model.TextMember] + "";
|
||||
textEditValue += rowItem[this.Model.ValueMember] + "";
|
||||
}
|
||||
else if (rowValueItem != null)
|
||||
{
|
||||
textEditText += rowItem[this.Model.TextMember] + "";
|
||||
textEditValue += rowItem[this.Model.ValueMember] + "";
|
||||
}
|
||||
}
|
||||
this.TextEdit.Text = textEditText.TrimEnd(',');
|
||||
return textEditValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
// this.Model.SourceSql = "select cltm as 编码,cltm 原纸条码 from WMS_BillOutUsedByPlanTab where #planlistid={planlistid}# and issn=1";
|
||||
this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql));
|
||||
if (this.table != null && this.table is DataTable)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
String[] strRating = value.Split(',');
|
||||
string textEditValue = string.Empty;
|
||||
string textEditText = string.Empty;
|
||||
if (strRating.Length > 0)
|
||||
{
|
||||
foreach (string strrating in strRating)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(strrating))
|
||||
{
|
||||
DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
textEditValue += rowItem[this.Model.ValueMember] + ",";
|
||||
textEditText += rowItem[this.Model.TextMember] + ",";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
textEditValue += rowItem[this.Model.ValueMember] + ",";
|
||||
textEditText += rowItem[this.Model.TextMember] + ",";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.TextEdit.EditValue = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (!string.IsNullOrWhiteSpace(textEditText)) textEditText = textEditText.Remove(textEditText.LastIndexOf(","), 1);
|
||||
//if (!string.IsNullOrWhiteSpace(editValue)) editValue = editValue.Remove(editValue.LastIndexOf(","), 1);
|
||||
|
||||
this.TextEdit.Text = textEditText.TrimEnd(',');
|
||||
this.editValue = textEditValue.TrimEnd(',');
|
||||
this.TextEdit.SelectionStart = this.Text.Length;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.EditValue = string.Empty;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.EditValue = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
this.simpleButton4.Width = this.simpleButton1.Width = this.Model.Size.Height + 10;
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = true;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:弹出框</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-01-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ShowPopup()
|
||||
{
|
||||
FrmGridSelectPopup popup = new FrmGridSelectPopup(this.Model, ControlObj,this.editValue,this.EditText);
|
||||
DialogResult result = popup.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
this.editValue = popup.ShowValue;
|
||||
this.EditText = popup.ShowText;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.editValue = this.EditText = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void txtEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ShowPopup();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ShowPopup();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton4_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.EditText = this.editValue = "";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Control.Model.MyControl ControlObj { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
public partial class LabelGridSelectEdit : BaseUserControl
|
||||
{
|
||||
private string editValue;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable table = new DataTable();
|
||||
public LabelGridSelectEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (Business.Impl.LanguageTranslation.Translatable)
|
||||
{
|
||||
simpleButton1.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton1.Text);
|
||||
simpleButton4.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton4.Text);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string EditValue
|
||||
{
|
||||
get
|
||||
{
|
||||
BaseUserControl control = null;
|
||||
if (this.Model != null) control = ControlObj.FindControl(this.Model.FieldName);
|
||||
if (this.Model != null && (this.Model.FieldType == ControlType.LabGridPopupValue || this.Model.FieldType == ControlType.LabGridPopupMutilValue))
|
||||
{
|
||||
this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql));
|
||||
if (!string.IsNullOrEmpty(editValue))
|
||||
{
|
||||
return editValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 存在名称并且没有value值则
|
||||
if (control != null && !string.IsNullOrEmpty(control.EditText))
|
||||
{
|
||||
if (table != null && table is DataTable)
|
||||
{
|
||||
String[] strRating = control.EditText.Split(',');
|
||||
string textEditValue = string.Empty;
|
||||
string textEditText = string.Empty;
|
||||
foreach (string strrating in strRating)
|
||||
{
|
||||
DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + "");
|
||||
DataRow rowValueItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
textEditText += rowItem[this.Model.TextMember] + "";
|
||||
textEditValue += rowItem[this.Model.ValueMember] + "";
|
||||
}
|
||||
else if (rowValueItem != null)
|
||||
{
|
||||
textEditText += rowItem[this.Model.TextMember] + "";
|
||||
textEditValue += rowItem[this.Model.ValueMember] + "";
|
||||
}
|
||||
}
|
||||
this.TextEdit.Text = textEditText.TrimEnd(',');
|
||||
return textEditValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
// this.Model.SourceSql = "select cltm as 编码,cltm 原纸条码 from WMS_BillOutUsedByPlanTab where #planlistid={planlistid}# and issn=1";
|
||||
this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql));
|
||||
if (this.table != null && this.table is DataTable)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
String[] strRating = value.Split(',');
|
||||
string textEditValue = string.Empty;
|
||||
string textEditText = string.Empty;
|
||||
if (strRating.Length > 0)
|
||||
{
|
||||
foreach (string strrating in strRating)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(strrating))
|
||||
{
|
||||
DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
textEditValue += rowItem[this.Model.ValueMember] + ",";
|
||||
textEditText += rowItem[this.Model.TextMember] + ",";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + "");
|
||||
if (rowItem != null)
|
||||
{
|
||||
textEditValue += rowItem[this.Model.ValueMember] + ",";
|
||||
textEditText += rowItem[this.Model.TextMember] + ",";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.TextEdit.EditValue = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (!string.IsNullOrWhiteSpace(textEditText)) textEditText = textEditText.Remove(textEditText.LastIndexOf(","), 1);
|
||||
//if (!string.IsNullOrWhiteSpace(editValue)) editValue = editValue.Remove(editValue.LastIndexOf(","), 1);
|
||||
|
||||
this.TextEdit.Text = textEditText.TrimEnd(',');
|
||||
this.editValue = textEditValue.TrimEnd(',');
|
||||
this.TextEdit.SelectionStart = this.Text.Length;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.EditValue = string.Empty;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.EditValue = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
this.simpleButton4.Width = this.simpleButton1.Width = this.Model.Size.Height + 10;
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = true;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:弹出框</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-01-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ShowPopup()
|
||||
{
|
||||
FrmGridSelectPopup popup = new FrmGridSelectPopup(this.Model, ControlObj,this.editValue,this.EditText);
|
||||
DialogResult result = popup.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
this.editValue = popup.ShowValue;
|
||||
this.EditText = popup.ShowText;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.editValue = this.EditText = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void txtEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ShowPopup();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ShowPopup();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void simpleButton4_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.EditText = this.editValue = "";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Control.Model.MyControl ControlObj { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+24
-1
@@ -154,4 +154,27 @@
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabelImageEdit";
|
||||
this.Size = new System.Drawing.Size(191, 135);
|
||||
this.cmsMenu.ResumeLayou
|
||||
this.cmsMenu.ResumeLayout(false);
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgFile.Properties)).EndInit();
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ContextMenuStrip cmsMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmi_cut;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmi_copy;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmi_delete;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmi_load;
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private DevExpress.XtraEditors.PictureEdit imgFile;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmi_Preview;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,4 +676,31 @@ namespace Lskj.Control
|
||||
/// <param name="name">The name.</param>
|
||||
private void InvokeMenuMethod(PictureMenu menu, string name)
|
||||
{
|
||||
MethodInfo mi = typeof(PictureM
|
||||
MethodInfo mi = typeof(PictureMenu).GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
if (mi != null && menu != null)
|
||||
mi.Invoke(menu, new object[] { menu, new EventArgs() });
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:获取右键菜单</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="edit">The edit.</param>
|
||||
/// <returns>PictureMenu.</returns>
|
||||
///
|
||||
private PictureMenu getMenu(PictureEdit edit)
|
||||
{
|
||||
PropertyInfo pi = typeof(PictureEdit).GetProperty("Menu", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
if (pi != null)
|
||||
return pi.GetValue(edit, null) as PictureMenu;
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,4 +263,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,4 +190,43 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,218 +1,257 @@
|
||||
/******************************
|
||||
* 说明:自定义Memo控件(类似于dev [A] 控件)
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义Memo控件
|
||||
/// </summary>
|
||||
public partial class LabelMemoSpaceEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoExEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelMemoSpaceEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
// 替换Memo编辑框中的单引号 避免保存sql语句出现引号丢失问题
|
||||
return this.txtEdit.Text.Replace("'", "''");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:内容改变时判断是否存在\r\n存在则替换为逗号</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-06-12 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTxtEditEditValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.EditText = txtEdit.Text.Replace("\r\n", ",");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
/******************************
|
||||
* 说明:自定义Memo控件(类似于dev [A] 控件)
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义Memo控件
|
||||
/// </summary>
|
||||
public partial class LabelMemoSpaceEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoExEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelMemoSpaceEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
// 替换Memo编辑框中的单引号 避免保存sql语句出现引号丢失问题
|
||||
return this.txtEdit.Text.Replace("'", "''");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:内容改变时判断是否存在\r\n存在则替换为逗号</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-06-12 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTxtEditEditValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.EditText = txtEdit.Text.Replace("\r\n", ",");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -459,4 +459,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,4 +399,43 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,4 +284,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+26
-1
@@ -99,4 +99,29 @@
|
||||
//
|
||||
// LabelMultiAutoTextEdit
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.plRight);
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabelMultiAutoTextEdit2";
|
||||
this.Size = new System.Drawing.Size(162, 21);
|
||||
this.plRight.ResumeLayout(false);
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.Panel plRight;
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private DevExpress.XtraEditors.SimpleButton btnMore;
|
||||
private DevExpress.XtraEditors.MemoEdit txtEdit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,420 +1,458 @@
|
||||
/******************************
|
||||
* 说明:自定义多选搜索框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-08
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Control.MultiModelLookUp;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义多选搜索框
|
||||
/// </summary>
|
||||
public partial class LabelMultiAutoTextEdit4 : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The _look up form
|
||||
/// </summary>
|
||||
public FrmModelLookUp2 _lookUpForm = null;
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
public string ValueMember = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值字段
|
||||
/// </summary>
|
||||
public string ValueField = string.Empty;
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public string TextField = string.Empty;
|
||||
/// <summary>
|
||||
/// 备注字段
|
||||
/// </summary>
|
||||
public string RemarkField = string.Empty;
|
||||
/// <summary>
|
||||
/// 数据源SQL
|
||||
/// </summary>
|
||||
public string SourceSQL = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
//public string EditValue = string.Empty;
|
||||
/// <summary>
|
||||
/// The contro object
|
||||
/// </summary>
|
||||
public MyControl ControlObj;
|
||||
/// <summary>
|
||||
/// 文本
|
||||
/// </summary>
|
||||
/// <value>The label.</value>
|
||||
public Label Label { get { return lblText; } }
|
||||
/// <summary>
|
||||
/// 自动搜索框控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 配置的关联ModuleCodel值
|
||||
/// </summary>
|
||||
/// <value>The Union ModuleCodel.</value>
|
||||
public string UnionModuleCodel;
|
||||
/// <summary>
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/// <summary>
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable DataSource;
|
||||
/// <summary>
|
||||
/// 显示text值(保存id,显示text值)
|
||||
/// </summary>
|
||||
public bool ModuleFrameDisplayText;
|
||||
|
||||
|
||||
private string editValue;
|
||||
|
||||
public LabelMultiAutoTextEdit4()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
if (ModuleFrameDisplayText)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && this.DataSource != null)
|
||||
{
|
||||
string[] values = value.Trim(',').Split(',');
|
||||
string text = string.Empty;
|
||||
foreach (string item in values)
|
||||
{
|
||||
DataRow rowItem = this.DataSource.Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == item);
|
||||
if (rowItem != null)
|
||||
{
|
||||
text += rowItem[TextField] + ",";
|
||||
}
|
||||
}
|
||||
this.txtEdit.Text = text.TrimEnd(',');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtEdit.Text = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.Text = value.TrimEnd(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public string EditValue;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:需要单独验证是否修改</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance is update; otherwise, <c>false</c>.</returns>
|
||||
public override bool IsUpdate()
|
||||
{
|
||||
if (Model.FieldType == ControlType.LabMultiSelectValue ||
|
||||
Model.FieldType == ControlType.LabMultiSelectValueNew ||
|
||||
Model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||
{
|
||||
return !this.Model.Text.Equals(this.EditValue, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.IsUpdate();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">数据源</param>
|
||||
public void InitialFrame()
|
||||
{
|
||||
_lookUpForm = new FrmModelLookUp2(UnionModuleCodel, IsRadio);
|
||||
_lookUpForm.ConfigureColumnMode = ConfigureColumnMode;
|
||||
_lookUpForm.ValueField = ValueField;
|
||||
_lookUpForm.ValueMember = ValueMember;
|
||||
_lookUpForm.TextField = TextField;
|
||||
//_lookUpForm.SourceSQL = SourceSQL;
|
||||
//_lookUpForm.DataSource = dataSource;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清空选中的值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-08-24 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ClearSelectForm()
|
||||
{
|
||||
// _lookUpForm.ClearSelect();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:打开界面</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void btnMore_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
_lookUpForm.EditValue = this.EditValue;
|
||||
_lookUpForm.IsType = Model.FieldType;
|
||||
_lookUpForm.EditText = this.TextEdit.Text;
|
||||
}
|
||||
|
||||
string sqlValue = _lookUpForm.SysModel.MenuSql + Model.SplicingConditions;
|
||||
//sqlValue = _lookUpForm.SysModel.MenuSql.Replace("#", "");
|
||||
if (this.ControlObj != null)
|
||||
{
|
||||
sqlValue = this.ControlObj.ReplaceControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
|
||||
//_lookUpForm.DataSource = MainImpl.GetDataTableResult(sqlValue);
|
||||
}
|
||||
_lookUpForm.NewSourceSQL = sqlValue;
|
||||
_lookUpForm.AddModuleResult = Model.AddModuleResult;
|
||||
_lookUpForm.InitControls(UnionModuleCodel);
|
||||
DialogResult result = _lookUpForm.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText;
|
||||
this.EditText = value;
|
||||
//this.EditValue = value;
|
||||
//this.TextEdit.Text = value;
|
||||
ControlObj.ModuleResultDic.Clear();
|
||||
foreach (string resultKey in _lookUpForm.ModuleResultDic.Keys)
|
||||
{
|
||||
string resultValue = _lookUpForm.ModuleResultDic[resultKey];
|
||||
if (ControlObj.FindControl(resultKey) == null)
|
||||
{
|
||||
ControlObj.ModuleResultDic.Add(resultKey, resultValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
ControlObj.SetControlValue(resultKey, resultValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
/******************************
|
||||
* 说明:自定义多选搜索框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-08
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using DevExpress.XtraEditors;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Control.MultiModelLookUp;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义多选搜索框
|
||||
/// </summary>
|
||||
public partial class LabelMultiAutoTextEdit4 : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The _look up form
|
||||
/// </summary>
|
||||
public FrmModelLookUp2 _lookUpForm = null;
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
public string ValueMember = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值字段
|
||||
/// </summary>
|
||||
public string ValueField = string.Empty;
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public string TextField = string.Empty;
|
||||
/// <summary>
|
||||
/// 备注字段
|
||||
/// </summary>
|
||||
public string RemarkField = string.Empty;
|
||||
/// <summary>
|
||||
/// 数据源SQL
|
||||
/// </summary>
|
||||
public string SourceSQL = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
//public string EditValue = string.Empty;
|
||||
/// <summary>
|
||||
/// The contro object
|
||||
/// </summary>
|
||||
public MyControl ControlObj;
|
||||
/// <summary>
|
||||
/// 文本
|
||||
/// </summary>
|
||||
/// <value>The label.</value>
|
||||
public Label Label { get { return lblText; } }
|
||||
/// <summary>
|
||||
/// 自动搜索框控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 配置的关联ModuleCodel值
|
||||
/// </summary>
|
||||
/// <value>The Union ModuleCodel.</value>
|
||||
public string UnionModuleCodel;
|
||||
/// <summary>
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/// <summary>
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable DataSource;
|
||||
/// <summary>
|
||||
/// 显示text值(保存id,显示text值)
|
||||
/// </summary>
|
||||
public bool ModuleFrameDisplayText;
|
||||
|
||||
|
||||
private string editValue;
|
||||
|
||||
public LabelMultiAutoTextEdit4()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
if (ModuleFrameDisplayText)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && this.DataSource != null)
|
||||
{
|
||||
string[] values = value.Trim(',').Split(',');
|
||||
string text = string.Empty;
|
||||
foreach (string item in values)
|
||||
{
|
||||
DataRow rowItem = this.DataSource.Rows.Cast<DataRow>().FirstOrDefault(x => x[ValueMember] + "" == item);
|
||||
if (rowItem != null)
|
||||
{
|
||||
text += rowItem[TextField] + ",";
|
||||
}
|
||||
}
|
||||
this.txtEdit.Text = text.TrimEnd(',');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtEdit.Text = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TextEdit.Text = value.TrimEnd(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public string EditValue;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:需要单独验证是否修改</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance is update; otherwise, <c>false</c>.</returns>
|
||||
public override bool IsUpdate()
|
||||
{
|
||||
if (Model.FieldType == ControlType.LabMultiSelectValue ||
|
||||
Model.FieldType == ControlType.LabMultiSelectValueNew ||
|
||||
Model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||
{
|
||||
return !this.Model.Text.Equals(this.EditValue, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.IsUpdate();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">数据源</param>
|
||||
public void InitialFrame()
|
||||
{
|
||||
_lookUpForm = new FrmModelLookUp2(UnionModuleCodel, IsRadio);
|
||||
_lookUpForm.ConfigureColumnMode = ConfigureColumnMode;
|
||||
_lookUpForm.ValueField = ValueField;
|
||||
_lookUpForm.ValueMember = ValueMember;
|
||||
_lookUpForm.TextField = TextField;
|
||||
//_lookUpForm.SourceSQL = SourceSQL;
|
||||
//_lookUpForm.DataSource = dataSource;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清空选中的值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-08-24 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ClearSelectForm()
|
||||
{
|
||||
// _lookUpForm.ClearSelect();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:打开界面</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void btnMore_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
if (_lookUpForm != null)
|
||||
{
|
||||
_lookUpForm.EditValue = this.EditValue;
|
||||
_lookUpForm.IsType = Model.FieldType;
|
||||
_lookUpForm.EditText = this.TextEdit.Text;
|
||||
}
|
||||
|
||||
string sqlValue = _lookUpForm.SysModel.MenuSql + Model.SplicingConditions;
|
||||
//sqlValue = _lookUpForm.SysModel.MenuSql.Replace("#", "");
|
||||
if (this.ControlObj != null)
|
||||
{
|
||||
sqlValue = this.ControlObj.ReplaceControlValue(sqlValue);
|
||||
sqlValue = sqlValue.Replace("#", "");
|
||||
|
||||
//_lookUpForm.DataSource = MainImpl.GetDataTableResult(sqlValue);
|
||||
}
|
||||
_lookUpForm.NewSourceSQL = sqlValue;
|
||||
_lookUpForm.AddModuleResult = Model.AddModuleResult;
|
||||
_lookUpForm.InitControls(UnionModuleCodel);
|
||||
DialogResult result = _lookUpForm.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText;
|
||||
this.EditText = value;
|
||||
//this.EditValue = value;
|
||||
//this.TextEdit.Text = value;
|
||||
ControlObj.ModuleResultDic.Clear();
|
||||
foreach (string resultKey in _lookUpForm.ModuleResultDic.Keys)
|
||||
{
|
||||
string resultValue = _lookUpForm.ModuleResultDic[resultKey];
|
||||
if (ControlObj.FindControl(resultKey) == null)
|
||||
{
|
||||
ControlObj.ModuleResultDic.Add(resultKey, resultValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
ControlObj.SetControlValue(resultKey, resultValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+30
-1
@@ -41,4 +41,33 @@ namespace Lskj.Control
|
||||
this.plLeft.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.plLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.plLeft.Name = "plLeft";
|
||||
|
||||
this.plLeft.Size = new System.Drawing.Size(39, 20);
|
||||
this.plLeft.TabIndex = 3;
|
||||
//
|
||||
// lblText
|
||||
//
|
||||
this.lblText.AutoSize = true;
|
||||
this.lblText.Location = new System.Drawing.Point(5, 4);
|
||||
this.lblText.Name = "lblText";
|
||||
this.lblText.Size = new System.Drawing.Size(29, 12);
|
||||
this.lblText.TabIndex = 1;
|
||||
this.lblText.Text = "名称";
|
||||
//
|
||||
// LabelPrompt
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.plLeft);
|
||||
this.Name = "LabelPrompt";
|
||||
this.Size = new System.Drawing.Size(39, 20);
|
||||
this.plLeft.ResumeLayout(false);
|
||||
this.plLeft.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel plLeft;
|
||||
private System.Windows.Forms.Label lblText;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,4 +91,38 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,4 +226,42 @@ namespace Lskj.Control
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+324
-286
@@ -1,286 +1,324 @@
|
||||
/******************************
|
||||
* 说明:自定义备注框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using System.IO;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义备注框
|
||||
/// </summary>
|
||||
public partial class LabelRemarkEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 当 lasttext 为空(清空)时触发。
|
||||
/// </summary>
|
||||
public event EventHandler LastTextEmpty;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 存储文件地址(用于保存上传)
|
||||
/// </summary>
|
||||
public string filepath;
|
||||
/// <summary>
|
||||
/// 存储原文件名
|
||||
/// </summary>
|
||||
public string lasttext;
|
||||
/// <summary>
|
||||
/// 是否变更新增
|
||||
/// </summary>
|
||||
public bool changeAdd;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void BandAllowDrop()
|
||||
{
|
||||
txtEdit.AllowDrop = true;
|
||||
txtEdit.DragEnter += OnDragEnter;
|
||||
txtEdit.DragDrop += OnDragDrop;
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽完成触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
|
||||
string filename = Path.GetFileName(file);
|
||||
if (!string.IsNullOrEmpty(lasttext) && string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件完全一样!");
|
||||
}
|
||||
else
|
||||
{
|
||||
string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase);
|
||||
string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase);
|
||||
if (!string.IsNullOrEmpty(lasttext) && !string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件不匹配!");
|
||||
}
|
||||
else
|
||||
{
|
||||
txtEdit.Text = filename;
|
||||
this.filepath = file;
|
||||
OnLastTextEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽为空触发回调
|
||||
/// </summary>
|
||||
protected virtual void OnLastTextEmpty()
|
||||
{
|
||||
LastTextEmpty?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
/// <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>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
|
||||
protected void OnDragEnter(object sender, System.Windows.Forms.DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop) &&
|
||||
((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1)
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
else
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
Graphics g = this.lblText.CreateGraphics();
|
||||
SizeF sizeF = g.MeasureString(value, this.lblText.Font);
|
||||
this.plLeft.Width = (int)sizeF.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
/******************************
|
||||
* 说明:自定义备注框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using System.IO;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义备注框
|
||||
/// </summary>
|
||||
public partial class LabelRemarkEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 当 lasttext 为空(清空)时触发。
|
||||
/// </summary>
|
||||
public event EventHandler LastTextEmpty;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 存储文件地址(用于保存上传)
|
||||
/// </summary>
|
||||
public string filepath;
|
||||
/// <summary>
|
||||
/// 存储原文件名
|
||||
/// </summary>
|
||||
public string lasttext;
|
||||
/// <summary>
|
||||
/// 是否变更新增
|
||||
/// </summary>
|
||||
public bool changeAdd;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void BandAllowDrop()
|
||||
{
|
||||
txtEdit.AllowDrop = true;
|
||||
txtEdit.DragEnter += OnDragEnter;
|
||||
txtEdit.DragDrop += OnDragDrop;
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽完成触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
|
||||
string filename = Path.GetFileName(file);
|
||||
if (!string.IsNullOrEmpty(lasttext) && string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件完全一样!");
|
||||
}
|
||||
else
|
||||
{
|
||||
string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase);
|
||||
string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase);
|
||||
if (!string.IsNullOrEmpty(lasttext) && !string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件不匹配!");
|
||||
}
|
||||
else
|
||||
{
|
||||
txtEdit.Text = filename;
|
||||
this.filepath = file;
|
||||
OnLastTextEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽为空触发回调
|
||||
/// </summary>
|
||||
protected virtual void OnLastTextEmpty()
|
||||
{
|
||||
LastTextEmpty?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
/// <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>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
|
||||
protected void OnDragEnter(object sender, System.Windows.Forms.DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop) &&
|
||||
((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1)
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
else
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
Graphics g = this.lblText.CreateGraphics();
|
||||
SizeF sizeF = g.MeasureString(value, this.lblText.Font);
|
||||
this.plLeft.Width = (int)sizeF.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,41 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// 是否只读
|
||||
/// </summary>
|
||||
/// <v
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return !this.TextEdit.Enabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.TextEdit.Enabled = !value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+251
-212
@@ -1,212 +1,251 @@
|
||||
/******************************
|
||||
* 说明:自定义文本框控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraPrinting.Native;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义文本框控件
|
||||
/// </summary>
|
||||
public partial class LabelTextEdit : BaseUserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelTextEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
|
||||
this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
/******************************
|
||||
* 说明:自定义文本框控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraPrinting.Native;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义文本框控件
|
||||
/// </summary>
|
||||
public partial class LabelTextEdit : BaseUserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelTextEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
|
||||
this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+29
-1
@@ -26,4 +26,32 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summa
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// richTextBox1
|
||||
//
|
||||
this.richTextBox1.Location = new System.Drawing.Point(26, 22);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.Size = new System.Drawing.Size(124, 96);
|
||||
this.richTextBox1.TabIndex = 0;
|
||||
this.richTextBox1.Text = "测试内容https://www.example.com测试";
|
||||
//
|
||||
// LabelTipWithLink
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.richTextBox1);
|
||||
this.Name = "LabelTipWithLink";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RichTextBox richTextBox1;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
+294
-256
@@ -1,256 +1,294 @@
|
||||
using DevExpress.XtraEditors;
|
||||
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 Lskj.Control
|
||||
{
|
||||
public partial class LabelWeigh : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
public SimpleButton Button { get { return btnRefresh; } }
|
||||
/// <summary>
|
||||
///接口地址
|
||||
/// </summary>
|
||||
public string url;
|
||||
/// <summary>
|
||||
///按钮点击
|
||||
/// </summary>
|
||||
public event EventHandler ButtonClick;
|
||||
public LabelWeigh()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public string ButtonText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.btnRefresh.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.btnRefresh.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plRight.Dock = DockStyle.Right;
|
||||
this.plRight.AutoSize = false;
|
||||
this.btnRefresh.AutoSize = false;
|
||||
this.btnRefresh.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnRefresh.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plRight.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plRight.AutoSize = true;
|
||||
this.plRight.Width = this.btnRefresh.Width;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
|
||||
this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ButtonClick != null) ButtonClick(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
using DevExpress.XtraEditors;
|
||||
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 Lskj.Control
|
||||
{
|
||||
public partial class LabelWeigh : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
public SimpleButton Button { get { return btnRefresh; } }
|
||||
/// <summary>
|
||||
///接口地址
|
||||
/// </summary>
|
||||
public string url;
|
||||
/// <summary>
|
||||
///按钮点击
|
||||
/// </summary>
|
||||
public event EventHandler ButtonClick;
|
||||
public LabelWeigh()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public string ButtonText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.btnRefresh.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.btnRefresh.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plRight.Dock = DockStyle.Right;
|
||||
this.plRight.AutoSize = false;
|
||||
this.btnRefresh.AutoSize = false;
|
||||
this.btnRefresh.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnRefresh.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plRight.Width = value.Length * GetCharWidth();
|
||||
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plRight.AutoSize = true;
|
||||
this.plRight.Width = this.btnRefresh.Width;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
|
||||
this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ButtonClick != null) ButtonClick(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容加粗
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool ContentBold
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.Font.Bold;
|
||||
}
|
||||
set
|
||||
{
|
||||
Font oldFont = TextEdit.Properties.Appearance.Font;
|
||||
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,4 +248,32 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创��
|
||||
/// 创建修改记录表
|
||||
/// </summary>
|
||||
public static void CreateModificationRecordTable()
|
||||
{
|
||||
if (!Lskj.Business.Impl.BaseImpl.HasExistsTable("P_SystemAuditChangeLog"))
|
||||
{
|
||||
string sqlValue = string.Format(@"CREATE TABLE P_SystemAuditChangeLog (
|
||||
id BIGINT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
orderNumber VARCHAR(50) NOT NULL, -- 单号
|
||||
fieldName NVARCHAR(500) NOT NULL, -- 字段名称
|
||||
oldValue NVARCHAR(500) NULL, -- 旧值(改动前)
|
||||
newValue NVARCHAR(500) NULL, -- 新值(改动后)
|
||||
stepCode INT NOT NULL, -- 步骤号
|
||||
operatorId int NOT NULL -- 人员id(改动人)
|
||||
);");
|
||||
BaseImpl.ExecSqlValue(sqlValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,4 +525,28 @@ namespace Lskj.Control.Model
|
||||
/// <para>说明:页签控件个数改变时更改标题字体大小</para>
|
||||
/// <para>创建人:唐德馨</para>
|
||||
/// <para>创建日期:2021-09-03</para>
|
||||
//
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private static void TabPages_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DevExpress.XtraTab.XtraTabPage tabPage = e.Element as DevExpress.XtraTab.XtraTabPage;
|
||||
if (e.Action.ToString().Equals("Add"))
|
||||
{
|
||||
tabPage.Appearance.Header.Font = new Font(tabPage.Appearance.Header.Font.OriginalFontName, Convert.ToSingle(tabPage.Appearance.Header.Font.Size * fontZoomValue * fontZoomValue));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = Lskj.Business.Impl.ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user