/// <summary> 重新注册 /// </summary> private void llblReg_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { UCForm.frmSoftReg regForm = new UCForm.frmSoftReg(); regForm.StartPosition = FormStartPosition.CenterScreen; DialogResult result = regForm.ShowDialog(); if (result == DialogResult.OK) { BindSignInfo(); } }
/// <summary> 重新注册 /// </summary> private void llblReg_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { UCForm.frmSoftReg regForm = new UCForm.frmSoftReg(); regForm.StartPosition = FormStartPosition.CenterScreen; DialogResult result = regForm.ShowDialog(); if (result == DialogResult.OK) { BindSignInfo(); } } catch (Exception ex) { GlobalStaticObj_Server.GlobalLogService.WriteLog("UCHomePage", ex); MessageBoxEx.ShowWarning("程序异常"); } }
/// <summary> 绑定签约信息 /// </summary> public void BindSignInfo() { #region 软件信息 DataTable dt = DBHelper.GetTable("获取软件用户信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_signing_info", "*", "", "", ""); if (dt.Rows.Count == 0 || dt.Rows[0]["authentication_status"].ToString() != DataSources.EnumAuthenticationStatus.AUTHORIZED.ToString("d")) { //弹出软件注册信息,如果用户取消注册,直接退出软件 UCForm.frmSoftReg regForm = new UCForm.frmSoftReg(); regForm.StartPosition = FormStartPosition.CenterScreen; DialogResult result = regForm.ShowDialog(); if (result != DialogResult.OK) { Application.Exit(); return; } else { dt = DBHelper.GetTable("获取软件用户信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_signing_info", "*", "", "", ""); } } DataRow dr = dt.Rows[0]; lblauthentication_status.Text = dr["authentication_status"].ToString() == ((int)DataSources.EnumYesNo.Yes).ToString() ? "已授权" : "未授权"; string dtStr = dr["protocol_expires_time"].ToString(); if (!string.IsNullOrEmpty(dtStr)) { long dateInt = Convert.ToInt64(dtStr); DateTime date = Common.UtcLongToLocalDateTime(dateInt); lblprotocol_expires_time.Text = date.ToString("yyyy-MM-dd"); } else { lblprotocol_expires_time.Text = "无"; } string version = "V" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); lblver.Text = version.Substring(0, version.Length - 2); lblmachine_code_sequence.Text = dr["machine_code_sequence"].ToString(); lblgrant_authorization.Text = dr["grant_authorization"].ToString(); lblcom_name.Text = dr["com_name"].ToString(); lblzip_code.Text = dr["zip_code"].ToString(); string proviceCode = dr["province"].ToString(); string cityCode = dr["city"].ToString(); string countyCode = dr["county"].ToString(); string detailAddr = dr["contact_address"].ToString(); string province = ""; if (!string.IsNullOrEmpty(proviceCode)) { province = DBHelper.GetSingleValue("获取省份", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + proviceCode + "'", ""); } string city = ""; if (!string.IsNullOrEmpty(cityCode)) { city = DBHelper.GetSingleValue("获取城市", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + cityCode + "'", ""); } string county = ""; if (!string.IsNullOrEmpty(countyCode)) { county = DBHelper.GetSingleValue("获取区县", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + countyCode + "'", ""); } lbCopanyAddress.Text = province + city + county + detailAddr; lblcontact.Text = dr["contact"].ToString(); lblcontact_tel.Text = dr["contact_tel"].ToString(); //lblcontact_tel.Text = dr["contact_phone"].ToString(); lblemail.Text = dr["email"].ToString(); lblfax.Text = dr["fax"].ToString(); #endregion }
/// <summary> 绑定签约信息 /// </summary> public void BindSignInfo() { #region 软件信息 DataTable dt = DBHelper.GetTable("获取软件用户信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_signing_info", "*", "", "", ""); if (dt.Rows.Count == 0) { //弹出软件注册信息,如果用户取消注册,直接退出软件 UCForm.frmSoftReg regForm = new UCForm.frmSoftReg(); regForm.StartPosition = FormStartPosition.CenterScreen; DialogResult result = regForm.ShowDialog(); if (result != DialogResult.OK) { Application.Exit(); return; } else { dt = DBHelper.GetTable("获取软件用户信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_signing_info", "*", "", "", ""); } } DataRow dr = dt.Rows[0]; lblauthentication_status.Text = dr["authentication_status"].ToString() == ((int)DataSources.EnumYesNo.Yes).ToString() ? "已授权" : "未授权"; string dtStr = dr["protocol_expires_time"].ToString(); if (!string.IsNullOrEmpty(dtStr)) { long dateInt = Convert.ToInt64(dtStr); DateTime date = Common.UtcLongToLocalDateTime(dateInt); lblprotocol_expires_time.Text = date.ToString("yyyy-MM-dd"); } else { lblprotocol_expires_time.Text = "无"; } string version = "V" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); lblver.Text = version.Substring(0, version.Length - 2); lblmachine_code_sequence.Text = dr["machine_code_sequence"].ToString(); lblgrant_authorization.Text = dr["grant_authorization"].ToString(); lblcom_name.Text = dr["com_name"].ToString(); lblzip_code.Text = dr["zip_code"].ToString(); string proviceCode = dr["province"].ToString(); string cityCode = dr["city"].ToString(); string countyCode = dr["county"].ToString(); string detailAddr = dr["contact_address"].ToString(); string province = ""; if (!string.IsNullOrEmpty(proviceCode)) { province = DBHelper.GetSingleValue("获取省份", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + proviceCode + "'", ""); } string city = ""; if (!string.IsNullOrEmpty(cityCode)) { city = DBHelper.GetSingleValue("获取城市", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + cityCode + "'", ""); } string county = ""; if (!string.IsNullOrEmpty(countyCode)) { county = DBHelper.GetSingleValue("获取区县", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + countyCode + "'", ""); } lbCopanyAddress.Text = province + city + county + detailAddr; lblcontact.Text = dr["contact"].ToString(); lblcontact_tel.Text = dr["contact_tel"].ToString(); //lblcontact_tel.Text = dr["contact_phone"].ToString(); lblemail.Text = dr["email"].ToString(); lblfax.Text = dr["fax"].ToString(); string dbName = GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode; yuTongWebService.GlobalStaticObj_YT.SAPCode = dr["service_station_sap"].ToString(); GlobalStaticObj_Server.Instance.ClientID = dr["access_code"].ToString(); //异步加载常量 new Thread(new ThreadStart( delegate() { //获取宇通加密秘钥 yuTongWebService.GlobalStaticObj_YT.KeySecurity_YT = DBHelper.GetSingleValue("获取服务站省份", dbName, "sys_config", "key_value", "key_name='KeySecurity_YT'", ""); //获取服务站所长省份,cxz GlobalStaticObj_Server.Instance.ServiceStationProvince = DBHelper.GetSingleValue("获取服务站省份", dbName, "tb_company", "province", string.Format("data_source='2' and sap_code='{0}'", yuTongWebService.GlobalStaticObj_YT.SAPCode), ""); DataTable dtBackupPlan = DBHelper.GetTable("", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "v_sys_auto_backup_set", "*", "", "", "order by setbook_code"); foreach (DataRow row in dtBackupPlan.Rows) { string setbook_code = row["setbook_code"].ToString(); if (!GlobalStaticObj_Server.Instance.DicBackupPlan.ContainsKey(setbook_code)) { string[] intArr = new string[4]; intArr[0] = row["auto_backup_type"].ToString(); intArr[1] = row["auto_backup_interval"].ToString(); intArr[2] = row["auto_backup_starttime"].ToString(); intArr[3] = ""; GlobalStaticObj_Server.Instance.DicBackupPlan.Add(setbook_code, intArr); } } } )).Start(); #endregion }
/// <summary> 绑定签约信息 /// </summary> public void BindSignInfo() { #region 软件信息 DataTable dt = DBHelper.GetTable("获取软件用户信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_signing_info", "*", "", "", ""); if (dt.Rows.Count == 0) { //弹出软件注册信息,如果用户取消注册,直接退出软件 UCForm.frmSoftReg regForm = new UCForm.frmSoftReg(); regForm.StartPosition = FormStartPosition.CenterScreen; DialogResult result = regForm.ShowDialog(); if (result != DialogResult.OK) { Application.Exit(); return; } else { dt = DBHelper.GetTable("获取软件用户信息", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "tb_signing_info", "*", "", "", ""); } } DataRow dr = dt.Rows[0]; lblauthentication_status.Text = dr["authentication_status"].ToString() == ((int)DataSources.EnumYesNo.Yes).ToString() ? "已授权" : "未授权"; string dtStr = dr["protocol_expires_time"].ToString(); if (!string.IsNullOrEmpty(dtStr)) { long dateInt = Convert.ToInt64(dtStr); DateTime date = Common.UtcLongToLocalDateTime(dateInt); lblprotocol_expires_time.Text = date.ToString("yyyy-MM-dd"); } else { lblprotocol_expires_time.Text = "无"; } string version = "V" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); lblver.Text = version.Substring(0, version.Length - 2); lblmachine_code_sequence.Text = dr["machine_code_sequence"].ToString(); lblgrant_authorization.Text = dr["grant_authorization"].ToString(); lblcom_name.Text = dr["com_name"].ToString(); lblzip_code.Text = dr["zip_code"].ToString(); string proviceCode = dr["province"].ToString(); string cityCode = dr["city"].ToString(); string countyCode = dr["county"].ToString(); string detailAddr = dr["contact_address"].ToString(); string province = ""; if (!string.IsNullOrEmpty(proviceCode)) { province = DBHelper.GetSingleValue("获取省份", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + proviceCode + "'", ""); } string city = ""; if (!string.IsNullOrEmpty(cityCode)) { city = DBHelper.GetSingleValue("获取城市", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + cityCode + "'", ""); } string county = ""; if (!string.IsNullOrEmpty(countyCode)) { county = DBHelper.GetSingleValue("获取区县", GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode, "sys_area", "area_name", "area_code='" + countyCode + "'", ""); } lbCopanyAddress.Text = province + city + county + detailAddr; lblcontact.Text = dr["contact"].ToString(); lblcontact_tel.Text = dr["contact_tel"].ToString(); //lblcontact_tel.Text = dr["contact_phone"].ToString(); lblemail.Text = dr["email"].ToString(); lblfax.Text = dr["fax"].ToString(); #endregion }