SVN r1048

SVN-Revision: r1048
This commit is contained in:
cyf
2025-11-20 09:02:59 +00:00
parent 2616d5dbad
commit 858bfc22f8
7 changed files with 144 additions and 166 deletions
@@ -247,13 +247,13 @@ namespace Lskj.Main.Control
ContextMenuStrip headMenuStrip = new ContextMenuStrip();
headMenuStrip.Opening += HeadMenuStripOpening;
ToolStripMenuItem removeOtherItem = new ToolStripMenuItem();
removeOtherItem.Text = "关闭其他";
removeOtherItem.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("关闭其他") : "关闭其他";
removeOtherItem.Click += new EventHandler(RemoveItemClick);
ToolStripMenuItem removeLeftItem = new ToolStripMenuItem();
removeLeftItem.Text = "关闭左侧";
removeLeftItem.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("关闭左侧") : "关闭左侧";
removeLeftItem.Click += new EventHandler(RemoveItemClick);
ToolStripMenuItem removeRightItem = new ToolStripMenuItem();
removeRightItem.Text = "关闭右侧";
removeRightItem.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("关闭右侧") : "关闭右侧";
removeRightItem.Click += new EventHandler(RemoveItemClick);
headMenuStrip.Items.Add(removeOtherItem);
headMenuStrip.Items.Add(removeLeftItem);
@@ -292,7 +292,7 @@ namespace Lskj.Main.Control
this.pl_top_left.Visible = false;
this.menuMain.Visible = false;
this.lblSubTitle.Visible = false;
this.toolStripLabel1.Text = "版本号:" + SystemInfo.Instance.Version;
this.toolStripLabel1.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("版本号") + "" + SystemInfo.Instance.Version : "版本号:" + SystemInfo.Instance.Version;
this.SetDesktop();
this.SetFormObject();
this.SetAccounts();//设置账套
@@ -455,11 +455,12 @@ namespace Lskj.Main.Control
private void SetFormObject()
{
this.lbUserName.Text = ERPInfo.Instance.UserName;
this.tsmi_userName.Text = "用户名:" + ERPInfo.Instance.UserName;
this.tsmi_account_book.Text = "账套:" + ERPInfo.Instance.AccountBook;
this.tsmi_userName.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("用户名") + "" + ERPInfo.Instance.UserName : "用户名:" + ERPInfo.Instance.UserName;
this.tsmi_account_book.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("账套") + "" + ERPInfo.Instance.AccountBook : "账套:" + ERPInfo.Instance.AccountBook;
this.tsmi_version.Text = string.Format("Version{0}", Assembly.GetExecutingAssembly().GetName().Version + "");
string updateTime = IniHelper.Read("ApplicationUpdateTime");
this.tsmi_upTime.Text = string.Format("更新时间:{0}", updateTime);
this.tsmi_upTime.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("更新时间") + "" + updateTime : "更新时间:" + updateTime;
//this.lblSubTitle.Text = !string.IsNullOrEmpty(ERPInfo.Instance.SubSysName) ? SystemInfo.Instance.ClientName + "-" + ERPInfo.Instance.SubSysName : SystemInfo.Instance.ClientName;
this.lblSubTitle.Text = (!string.IsNullOrEmpty(ERPInfo.Instance.SubSysName) && SystemInfo.Instance.ShowSubSysName) ? SystemInfo.Instance.ClientName + "-" + ERPInfo.Instance.SubSysName : SystemInfo.Instance.ClientName;
@@ -470,6 +471,16 @@ namespace Lskj.Main.Control
this.menuMain.Visible = true;
this.lblSubTitle.Visible = SystemInfo.Instance.HideSubtitle ? false : true;
this.ResetPanelWidth();
if (LanguageTranslation.Translatable)
{
foreach (XtraTabPage page in tabMain.TabPages)
{
string text = page.Text;
text = LanguageTranslation.GetTranslatedText(text.Trim());
if (!text.Equals(page.Text.Trim())) page.Text = text;
}
}
}
/// <summary>
/// <para>说明:子系统快捷窗口</para>
@@ -889,7 +900,7 @@ namespace Lskj.Main.Control
string menuCaption = item["menucaption"] + "";
string menuid = item["menuid"] + "";
string menuposition = item.Table.Columns.Contains("menuposition") ? item["menuposition"] + "" : "0";
if (menuCaption.Equals(SystemInfo.Instance.SplitBar)) continue;
if (!string.IsNullOrWhiteSpace(SystemInfo.Instance.SplitBar) && menuCaption.StartsWith(SystemInfo.Instance.SplitBar)) continue;
// 加载左侧菜单
if (menuStruct.Length == 2)
{
@@ -937,8 +948,8 @@ namespace Lskj.Main.Control
#region
if (this._allMenus.Columns.Contains("menuposition") && (SystemInfo.Instance.IsOpenWork || SystemInfo.Instance.ShowGallerysFromMenu) && !SystemInfo.Instance.HideGallerys)
{
List<DataRow> layoutTopDataRows = rows.Where(n => (n["menuposition"] + "").Equals("1") && (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(n["menucaption"] + "").Equals(SystemInfo.Instance.SplitBar)).ToList();
List<DataRow> layoutBotDataRows = rows.Where(n => (n["menuposition"] + "").Equals("2") && (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(n["menucaption"] + "").Equals(SystemInfo.Instance.SplitBar)).ToList();
List<DataRow> layoutTopDataRows = rows.Where(n => (n["menuposition"] + "").Equals("1") && (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(!string.IsNullOrWhiteSpace(SystemInfo.Instance.SplitBar) && (n["menucaption"] + "").StartsWith(SystemInfo.Instance.SplitBar))).ToList();
List<DataRow> layoutBotDataRows = rows.Where(n => (n["menuposition"] + "").Equals("2") && (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(!string.IsNullOrWhiteSpace(SystemInfo.Instance.SplitBar) && (n["menucaption"] + "").StartsWith(SystemInfo.Instance.SplitBar))).ToList();
TableLayoutPanel topLayoutPanel = new TableLayoutPanel();
topLayoutPanel.Dock = DockStyle.Fill;
topLayoutPanel.RowCount = layoutTopDataRows.Count() + 1;
@@ -1034,11 +1045,11 @@ namespace Lskj.Main.Control
List<DataRow> groupDataRows = new List<DataRow>();
if (this._allMenus.Columns.Contains("menuposition"))
{
groupDataRows = rows.Where(n => (n["menuposition"] + "").Equals("0") && (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(n["menucaption"] + "").Equals(SystemInfo.Instance.SplitBar)).ToList();
groupDataRows = rows.Where(n => (n["menuposition"] + "").Equals("0") && (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(!string.IsNullOrEmpty(SystemInfo.Instance.SplitBar) && (n["menucaption"] + "").StartsWith(SystemInfo.Instance.SplitBar))).ToList();
}
else
{
groupDataRows = rows.Where(n => (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(n["menucaption"] + "").Equals(SystemInfo.Instance.SplitBar)).ToList();
groupDataRows = rows.Where(n => (n["menustruct"] + "").Length == 4 && (n["menustruct"] + "").Substring(0, 2).Equals(menuStruct) && !(!string.IsNullOrEmpty(SystemInfo.Instance.SplitBar) && (n["menucaption"] + "").StartsWith(SystemInfo.Instance.SplitBar))).ToList();
}
foreach (DataRow dataRow in groupDataRows)
{
@@ -1697,7 +1708,7 @@ namespace Lskj.Main.Control
string menuCaption = row["MenuCaption"] + "";
ToolStripMenuItem subItem = new ToolStripMenuItem(menuCaption);
subItem.Font = new Font("微软雅黑", 10);
if (menuCaption.Equals(SystemInfo.Instance.SplitBar)) subItem.Enabled = false;
if (!string.IsNullOrEmpty(SystemInfo.Instance.SplitBar) && menuCaption.StartsWith(SystemInfo.Instance.SplitBar)) subItem.Enabled = false;
// 功能模块
try
{
@@ -1718,7 +1729,7 @@ namespace Lskj.Main.Control
childItem.Text = child["MenuCaption"] + "";
childItem.Font = new Font("微软雅黑", 10);
childItem.Tag = new string[] { child["DllFileName"] + "", child["PurviewId"] + "", child["MenuId"] + "", child["UrlParams"] + "", subSysId + "", child["MenuCaption"] + "" };
if (!childItem.Text.Equals(SystemInfo.Instance.SplitBar))
if (!(!string.IsNullOrEmpty(SystemInfo.Instance.SplitBar) && childItem.Text.StartsWith(SystemInfo.Instance.SplitBar)))
{
childItem.Click += OnItemClick; ;
}
@@ -3525,7 +3536,7 @@ namespace Lskj.Main.Control
{
string menuId = lueUserName.EditValue;
if (lueUserName._popup.GridViewObj.GetFocusedDataRow()==null)
if (lueUserName._popup.GridViewObj.GetFocusedDataRow() == null)
{
menuId = "";
}
+6 -31
View File
@@ -233,6 +233,11 @@ namespace Lskj.Main
DBConfig.Instance.Connection = Connection;
if (DBConfig.Instance.CreateConnection(Connection))
{
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
{
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
return;
}
if (isSave)
{
if (!string.IsNullOrEmpty(this.txtZTName.Text))
@@ -246,34 +251,4 @@ namespace Lskj.Main
DBConfig.Instance.WriteConfig("LocalLastIP", this.txtIP.Text);
DBConfig.Instance.WriteConfig("LocalLastPort", this.txtPort.Text);
DBConfig.Instance.WriteConfig("LocalLastPortName", this.txtZTName.Text);
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
MessageUtil.Show("请设置账套名!");
}
}
else
{
MessageUtil.Show(ResourceKeys.ConnectSuccess);
}
}
else
{
MessageUtil.Show(ResourceKeys.ConnectFault);
}
}
else
{
MessageUtil.Show(ResourceKeys.ConnectFault);
}
//IniHelper.Write("SystemResources.ini", "FrmConfigFlag", "1");
}
catch (Exception)
{
MessageUtil.Show(ResourceKeys.ConnectFault);
}
}
}
}
t
+7
View File
@@ -71,6 +71,13 @@ namespace Lskj.Main
if (DBConfig.Instance.CreateConnection(Connection))
{
DBConfig.Instance.Connection = Connection;
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
{
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
return;
}
this.DialogResult = DialogResult.OK;
IniHelper.Write("SystemResources.ini", "FrmConfigFlag", "1");
this.Close();
+17 -32
View File
@@ -444,6 +444,7 @@ namespace Lskj.Main
string userName = lueUserName.Text.Trim();
string password = txtPassword.Text.Trim();
string LoginAccount = string.Empty;
string ErrorLogText= string.Empty;//日志记录信息
// 设置登录用户信息
bool isConstraint = chkLogin.Checked;
if (string.IsNullOrWhiteSpace(userName))
@@ -677,7 +678,8 @@ namespace Lskj.Main
ERPInfo.Instance.LanguageName = this.language.Text;
LanguageTranslation.GetLanguageComparisonTable();//获取翻译表数据
Localizer.Active = new XtraLocalizer();
if (!string.IsNullOrWhiteSpace(ERPInfo.Instance.LanguageName)&& !ERPInfo.Instance.LanguageName.Equals("中文"))Localizer.Active = new XtraLocalizer();
this.SetDelphiDllParams(); // 设置调用delphi参数
@@ -725,6 +727,8 @@ namespace Lskj.Main
}
break;
case 1: // 密码不正确
ErrorLogText = string.Format("登录用户Id{0}\r\n登录用户名称:{1}\r\n输入密码:{2}", userId, userName, password);
LogUtil.WriteDebug("", "登录失败", ErrorLogText, "");
MessageUtil.Show(ResourceKeys.NameOrPasswordError);
break;
case 2: // 已有此用户登录
@@ -735,6 +739,8 @@ namespace Lskj.Main
break;
case -1: // 登录失败
default:
ErrorLogText = string.Format("登录用户Id{0}\r\n登录用户名称:{1}\r\n输入密码:{2}", userId, userName, password);
LogUtil.WriteDebug("", "登录失败", ErrorLogText, "");
MessageUtil.Show(ResourceKeys.LoginFault);
break;
}
@@ -1070,6 +1076,10 @@ namespace Lskj.Main
this.chkUpdate.Checked = DBConfig.Instance.UpdateSet;
this.chkClient.Checked = DBConfig.Instance.SmallClient;
this.chkNotice.Checked = DBConfig.Instance.NoticeClient;
if (SystemInfo.Instance.AllowForgetPwd)
{
this.forgetPwd.Visible = true;//允许修改密码
}
if (SystemInfo.Instance.AutomaticUpdates)
{
this.chkUpdate.Checked = true;
@@ -1090,7 +1100,7 @@ namespace Lskj.Main
this.chkRemPwd.Enabled = false;//记住密码禁止修改
}
if (SystemInfo.Instance.HiddenIntelligentClient|| SystemInfo.Instance.HiddenNotification || SystemInfo.Instance.HiddenServerSetting)
if (SystemInfo.Instance.HiddenIntelligentClient || SystemInfo.Instance.HiddenNotification || SystemInfo.Instance.HiddenServerSetting)
{
List<System.Windows.Forms.Control> controls = new List<System.Windows.Forms.Control>();
//隐藏 智能客户端
@@ -1117,15 +1127,15 @@ namespace Lskj.Main
controls.Add(this.pictureBox1);
foreach (System.Windows.Forms.Control item in controls)
{
if (item.Visible)
if (item.Visible)
{
item.Location = new Point(X, item.Location.Y);
X= item.Location.X + item.Width + 10;
X = item.Location.X + item.Width + 10;
if (item is PictureBox) this.btnSetConfig.Location = new Point(item.Location.X + item.Width, this.btnSetConfig.Location.Y);
}
}
}
this.BackgroundImage = BitMapHelper.getBitmap(BitMapEnum.loginbg);
this.lblCopyright.Text = string.IsNullOrEmpty(SystemInfo.Instance.CopyRight) ? this.lblCopyright.Text : SystemInfo.Instance.CopyRight;
@@ -1659,7 +1669,7 @@ namespace Lskj.Main
if (chkRemPwd.Checked)
{
this.txtPassword.Text = PwdState[1];
if(PwdState.Count() > 2) this.txtPassword.Text=string.Join("^", PwdState.Skip(1));
if (PwdState.Count() > 2) this.txtPassword.Text = string.Join("^", PwdState.Skip(1));
isClear = false;
this.lueUserName.Text = UserName;
this.txtPassword.Focus();
@@ -1821,29 +1831,4 @@ namespace Lskj.Main
/// <summary>
/// 忘记密码点击时
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnForgetPwdClick(object sender, EventArgs e)
{
using (BaseForm baseForm = new BaseForm())
{
FrmWebBrowser frmWebBrowser = new FrmWebBrowser();
frmWebBrowser.Dock = DockStyle.Fill;
baseForm.Controls.Add(frmWebBrowser);
baseForm.Text = "忘记密码";
baseForm.Size = new Size(1000, 600);
string forgetPwdUrl = "";
if (SystemInfo.Instance.OAUrl.EndsWith("/"))
{
forgetPwdUrl = $"{SystemInfo.Instance.OAUrl}lserp_v8/index.html?verify=1";
}
else
{
forgetPwdUrl = $"{SystemInfo.Instance.OAUrl}/lserp_v8/index.html?verify=1";
}
frmWebBrowser.FrmLoad(forgetPwdUrl, 1, false);
baseForm.ShowDialog();
}
}
}
}
/// <param n
+29 -36
View File
@@ -101,41 +101,34 @@ namespace Lskj.Main
return;
}
int result = MainImpl.ForceUpdatePassword(UserId, pass_after);
switch (result)
if (BaseImpl.HasExistsStoredProcedure("pr_sytemchangepsw"))
{
case 0: // 用户不存在
MessageUtil.Show(ResourceKeys.UserNotFound);
break;
case 1:
MessageUtil.Show(ResourceKeys.PasswordUpdateSuccess);
ERPInfo.Instance.Password = SHAHelper.EncryptPassword(pass_after);
this.DialogResult = DialogResult.OK;
break;
string tipMsg = string.Empty;
int result = MainImpl.ChangePassword(UserId, pass_after, out tipMsg);
switch (result)
{
case 1: // 修改成功
MessageUtil.Show(ResourceKeys.PasswordUpdateSuccess);
ERPInfo.Instance.Password = SHAHelper.EncryptPassword(pass_after);
MainImpl.RecordPassword(pass_after);
this.DialogResult = DialogResult.OK;
break;
default:
MessageUtil.Show("修改失败:" + tipMsg);
break;
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show("修改密码出错!" + Message);
}
}
/// <summary>
/// <para>说明:取消修改</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-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>
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
else
{
int result = MainImpl.ForceUpdatePassword(UserId, pass_after);
switch (result)
{
case 0: // 用户不存在
MessageUtil.Show(ResourceKeys.UserNotFound);
break;
case 1:
MessageUtil.Show(ResourceKeys.PasswordUpdateSuccess);
ERPInfo.Instance.Password = SHAHelper.EncryptPassword(pass_after);
ERPInfo.Instance.InPassWord = pass_after;
MainImpl.RecordPassword(pass_after);
this.
+41 -49
View File
@@ -86,54 +86,46 @@ namespace Lskj.Main
return;
}
int result = MainImpl.UpdatePassword(ERPInfo.Instance.UserId, beforePass, afterPass);
switch (result)
if (BaseImpl.HasExistsStoredProcedure("pr_sytemchangepsw"))
{
case 0: // 用户不存在
MessageUtil.Show(ResourceKeys.UserNotFound);
break;
case 1: // 修改成功
MessageUtil.Show(ResourceKeys.PasswordUpdateSuccess);
if (SystemInfo.Instance.UpdPwdAllSystem)
{
if (MainImpl.UpdatePasswordAllSubsystem(ERPInfo.Instance.UserId, afterPass))
{
MessageUtil.Show("用户对应账套密码修改成功");
}
else
{
MessageUtil.Show("用户对应账套密码修改失败");
}
}
Manager.StartForm();
break;
case 2: // 旧密码不正确.
MessageUtil.Show(ResourceKeys.OldPasswordFault);
break;
string tipMsg = string.Empty;
int result = MainImpl.ChangePassword(ERPInfo.Instance.UserId, afterPass, out tipMsg);
switch (result)
{
case 1: // 修改成功
MessageUtil.Show(ResourceKeys.PasswordUpdateSuccess);
MainImpl.RecordPassword(afterPass);
Manager.ReLogin();
break;
default:
MessageUtil.Show("修改失败:"+ tipMsg);
break;
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show("修改密码出错!" + Message);
}
}
/// <summary>
/// <para>说明:退出修改</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-08-15 </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 btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
else
{
int result = MainImpl.UpdatePassword(ERPInfo.Instance.UserId, beforePass, afterPass);
switch (result)
{
case 0: // 用户不存在
MessageUtil.Show(ResourceKeys.UserNotFound);
break;
case 1: // 修改成功
MessageUtil.Show(ResourceKeys.PasswordUpdateSuccess);
if (SystemInfo.Instance.UpdPwdAllSystem)
{
if (MainImpl.UpdatePasswordAllSubsystem(ERPInfo.Instance.UserId, afterPass))
{
MessageUtil.Show("用户对应账套密码修改成功");
}
else
{
MessageUtil.Show("用户对应账套密码修改失败");
}
}
MainImpl.RecordPassword(afterPass);
Manager.ReLogin();
//Manager.ReStartMain(true);
break;
case 2: // 旧密码不正确.
Messag
+18 -3
View File
@@ -1014,7 +1014,7 @@ namespace Lskj.Main.Model
bool hasEn = false;
if (urlParams.Length > 1)
{
string[] queryParams = urlParams[1].Split('&');
string[] queryParams = string.Join("?", urlParams.Skip(1)).Split('&');
List<string> qpLS = new List<string>();
Hashtable pms = new Hashtable();
hasEn = queryParams.Any(str => str.Trim().StartsWith(enKey, StringComparison.OrdinalIgnoreCase));
@@ -1025,9 +1025,24 @@ namespace Lskj.Main.Model
{
if (hasEn && eqParams[0].ToLower() == enKey)
{
enVal = eqParams[1];
enVal = string.Join("=", eqParams.Skip(1));
continue;
}
if (hasEn || eqParams[0].ToLower() == "username" || eqParams[0].ToLower() == "password")
{
pms.Add(eqParams[0
pms.Add(eqParams[0], string.Join("=", eqParams.Skip(1)));
}
else
{
qpLS.Add(string.Format("{0}={1}", eqParams[0], HttpUtility.UrlEncode(HttpUtility.UrlDecode(string.Join("=", eqParams.Skip(1)))).Replace("%5c", "/").Replace("%2f", "/").Replace("//", "/")));
}
}
else
{
}
}
if (pms.Count > 0)
{
DateTime dateTime = DateTime.Now.AddDays(1);
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);