You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
154 lines
4.7 KiB
154 lines
4.7 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using ICSSoft.Base.UserControl.MessageControl;
|
|
using ICSSoft.Base.Language.Tool;
|
|
using System.Windows.Forms;
|
|
using ICSSoft.Base.Config.AppConfig;
|
|
|
|
namespace ICSSoft.Frame.APP
|
|
{
|
|
public class ICSBaseSimpleCode
|
|
{
|
|
private static readonly int defaultTipType = 0;
|
|
|
|
|
|
#region MessageBox OverriWrite
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="info"></param>
|
|
/// <returns></returns>
|
|
public static void AppshowMessageBox(string info)
|
|
{
|
|
List<LangObj> langList = new List<LangObj>();
|
|
|
|
|
|
LangObj langObj = new LangObj();
|
|
langObj.LConvertString = info;
|
|
langObj.LParameters = new object[] { };
|
|
langList.Add(langObj);
|
|
|
|
if (langList.Count > 0)
|
|
{
|
|
MessageDialog messBox = new MessageDialog(defaultTipType, langList);
|
|
messBox.ShowDialog();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="info"></param>
|
|
/// <returns></returns>
|
|
public static void AppshowMessageBox(int TipType, string info)
|
|
{
|
|
List<LangObj> langList = new List<LangObj>();
|
|
|
|
|
|
LangObj langObj = new LangObj();
|
|
langObj.LConvertString = info;
|
|
langObj.LParameters = new object[] { };
|
|
langList.Add(langObj);
|
|
|
|
if (langList.Count > 0)
|
|
{
|
|
MessageDialog messBox = new MessageDialog(TipType, langList);
|
|
messBox.ShowDialog();
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="info"></param>
|
|
/// <returns></returns>
|
|
public static void AppshowMessageBox(List<string> info)
|
|
{
|
|
List<LangObj> langList = new List<LangObj>();
|
|
|
|
foreach (string str in info)
|
|
{
|
|
LangObj langObj = new LangObj();
|
|
langObj.LConvertString = str;
|
|
langObj.LParameters = new object[] { };
|
|
langList.Add(langObj);
|
|
|
|
}
|
|
if (langList.Count > 0)
|
|
{
|
|
MessageDialog messBox = new MessageDialog(defaultTipType, langList);
|
|
messBox.ShowDialog();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="info"></param>
|
|
/// <returns></returns>
|
|
public static void AppshowMessageBox(int TipType, List<string> info)
|
|
{
|
|
|
|
List<LangObj> langList = new List<LangObj>();
|
|
|
|
foreach (string str in info)
|
|
{
|
|
LangObj langObj = new LangObj();
|
|
langObj.LConvertString = str;
|
|
langObj.LParameters = new object[] { };
|
|
langList.Add(langObj);
|
|
|
|
}
|
|
if (langList.Count > 0)
|
|
{
|
|
ICSSoft.Base.UserControl.MessageControl.MessageDialog messBox = new MessageDialog(TipType, langList);
|
|
messBox.ShowDialog();
|
|
return;
|
|
}
|
|
}
|
|
|
|
public static DialogResult AppshowMessageBoxRepose(string strinfo)
|
|
{
|
|
List<LangObj> langList = new List<LangObj>();
|
|
LangObj obj = new LangObj();
|
|
obj.LConvertString = strinfo;
|
|
obj.LParameters = new object[] { };
|
|
langList.Add(obj);
|
|
RequestionDialog formRequestion = new RequestionDialog(langList);
|
|
return formRequestion.ShowDialog();
|
|
}
|
|
|
|
public static DialogResult AppshowMessageBoxRepose(List<string> info)
|
|
{
|
|
List<LangObj> langList = new List<LangObj>();
|
|
foreach (string str in info)
|
|
{
|
|
LangObj obj = new LangObj();
|
|
obj.LConvertString = str;
|
|
obj.LParameters = new object[] { };
|
|
langList.Add(obj);
|
|
}
|
|
RequestionDialog formRequestion = new RequestionDialog(langList);
|
|
return formRequestion.ShowDialog();
|
|
}
|
|
#endregion
|
|
public static string GetWorkPointErpData()
|
|
{
|
|
//return AppConfig.GetDataBaseNameByConnectString(AppConfig.GetDataBaseConnectStringByKey("[DB.ERP]"));
|
|
|
|
string con = AppConfig.GetDataBaseConnectStringByKey("[DB.ERP]");
|
|
string conbegin = "Data Source=";
|
|
int begin = con.IndexOf(conbegin);
|
|
int end = con.IndexOf(";Database=");
|
|
string IP = con.Substring(begin + conbegin.Length, end - begin - conbegin.Length);
|
|
return "[" + IP + "]." + AppConfig.GetDataBaseNameByConnectString(con);
|
|
}
|
|
}
|
|
}
|