protected void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); base.DisableTop(false); base.BodyClass = "class='bodybg'"; int.TryParse(Request.Form["i"], out ApplyEffectID); if (ApplyEffectID == 0) { string script = "<script>alert('資料取得失敗');history.go(-1);</script>"; Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false); return; } var user = AuthServer.GetLoginUser(); int Chk = 0; using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("dbo.usp_ParameterM_xRemoveApplyEffectByID", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ApplyEffectID", ApplyEffectID); SqlParameter sp = cmd.Parameters.AddWithValue("@Chk", Chk); sp.Direction = ParameterDirection.Output; sc.Open(); cmd.ExecuteNonQuery(); Chk = (int)sp.Value; } } OPVM VM = new OPVM(); VM.chk = Chk; Response.ContentType = "application/json; charset=utf-8"; Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { SearchPower = base.AddPower(SearchPower); UserVM user = AuthServer.GetLoginUser(); int pgNow; int pgSize; int.TryParse(Request.Form["pgNow"], out pgNow); int.TryParse(Request.Form["pgSize"], out pgSize); DataSet ds = new DataSet(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("usp_VaccineIn_xSearchLogin", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@pgNow", pgNow); cmd.Parameters.AddWithValue("@pgSize", pgSize); cmd.Parameters.AddWithValue("@InOrgID", user.OrgID); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(ds); } } } List <VaccineInPendingVM> list = new List <VaccineInPendingVM>(); PageVM rtn = new PageVM(); EntityS.FillModel(list, ds.Tables[0]); EntityS.FillModel(rtn, ds.Tables[1]); rtn.message = list; Response.ContentType = "application/json; charset=utf-8"; Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { int ID = 0; int.TryParse(Request["i"], out ID); DownloadVM VM = new DownloadVM(ID); var user = AuthServer.GetLoginUser(); DataTable dt = new DataTable(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("dbo.usp_FileM_xGetFileInfoByID", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", VM.ID); cmd.Parameters.AddWithValue("@OrgID", user.OrgID); cmd.CommandType = CommandType.StoredProcedure; using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(dt); } } } if (dt.Rows.Count > 0) { string Json = JsonConvert.SerializeObject(VM); string code = QueryStringEncryptToolS.Encrypt(Json); Response.Redirect("http://niis_fs.hyweb.com.tw/livestorage.aspx?o=" + HttpUtility.UrlEncode(code)); //Response.Redirect("http://localhost:64351/livestorage.aspx?o=" + HttpUtility.UrlEncode(code)); Response.End(); } else { Response.Redirect("~/html/ErrorPage/NoPower.html"); } }
private static void Main(string[] args) { Console.WriteLine("Starting Imagination Server!"); Console.WriteLine("Loading config..."); Config.Init(); Console.WriteLine($"Address: {Config.Current.Address}"); Console.WriteLine($"Encrypt Packets: {Config.Current.EncryptPackets}"); Console.WriteLine(" ->OK"); try { Console.WriteLine("Setting up database..."); SessionHelper.Init(); Console.WriteLine(" ->OK"); Console.WriteLine("Setting up CDClient Database..."); CdClientDb.Init(); Console.WriteLine(" ->OK"); } catch (FluentConfigurationException exception) { Console.WriteLine(exception.Message); Console.WriteLine(exception.InnerException); foreach (var reason in exception.PotentialReasons) { Console.WriteLine(" - " + reason); } Console.ReadKey(true); Environment.Exit(-1); } Console.WriteLine("Starting Auth..."); AuthServer.Init(Config.Current.Address); Console.WriteLine(" ->OK"); Console.WriteLine("Starting World..."); WorldServer.Init(Config.Current.Address); Console.WriteLine(" ->OK"); Console.WriteLine("Beginning message receiving..."); while (!Environment.HasShutdownStarted) { WorldServer.Service(); AuthServer.Service(); } }
protected void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); base.DisableTop(true); base.BodyClass = "class='bodybg'"; user = AuthServer.GetLoginUser(); if (this.IsPostBack == false) { List <int> list = new List <int>() { 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; var dict = SystemCode.GetDict("RecordM_StudentRecord_VaccineCate"); if (dict.Count > 0) { var query = dict.Where(item => list.Contains(item.EnumValue)); tbAry = JsonConvert.SerializeObject(query); } int nowYear = DateTime.Now.Year - 1911; ddlYear.Items.Add(new ListItem(nowYear.ToString() + "年", nowYear.ToString())); ddlYear.Items.Add(new ListItem((nowYear + 1).ToString() + "年", (nowYear + 1).ToString())); //if (SystemElementarySchool.list.Count > 0) //{ // ddlSchool.Items.Add(new ListItem("0", "請選擇學校名稱")); // foreach(var item in SystemElementarySchool.list) // { // ddlSchool.Items.Add(new ListItem(item.ElementarySchoolID.ToString(), item.SchoolName)); // } //} if (SystemElementarySchool.list.Count > 0) { sAry = JsonConvert.SerializeObject(SystemElementarySchool.list); } } }
public void Dispose() { //_main_mre.WaitOne(); Stop(); _timer.Dispose(); _registered_servers = null; _recent_server_creators_IPs = null; AuthServer.Dispose(); AuthServer = null; DbServer.Dispose(); DbServer = null; Socket = null; Status = ServerStatus.Uninitialized; OnTermination?.Invoke(this, null); }
protected new void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); base.DisableTop(false); if (Request.HttpMethod.Equals("POST")) { var user = AuthServer.GetLoginUser(); CaseUserID = GetNumber <int>("i"); if (CaseUserID == 0) { IsValid = false; string script = "<style>body{display:none;}</style><script>alert('資料取得失敗');history.go(-1);</script>"; Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false); return; } if (this.IsPostBack == false) { DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_CertificateM_xGetCaseUserNameByID" , new Dictionary <string, object>() { { "@CaseUserID", CaseUserID } }); if (dt.Rows.Count > 0) { tbName.Text = dt.Rows[0]["ChName"].ToString(); tbE.Text = dt.Rows[0]["EnName"].ToString(); } } } else { Response.Write(""); Response.End(); } }
public override void ExecuteCommand(AuthServer server, string[] arguments) { if (arguments.Length < 5) { log.ErrorFormat("{0} requires 4 arguments", Name); } else { string name = arguments[1]; string address = arguments[2]; int port = int.Parse(arguments[3]); string type = arguments[4]; log.InfoFormat("creating new shard '{0}'", name); if (server.AuthDB.ExecuteQuery("select 1 from shard where name = ?", name, reader => { if (reader.Read()) { log.ErrorFormat("cannot create shard '{0}': a shard with this name already exists", name); return(false); } return(true); })) { // they should really add a type param overload of this method ShardType typeOrdinal = (ShardType)Enum.Parse(typeof(ShardType), type, true); int result = server.AuthDB.ExecuteNonQuery("insert into shard (name, address, port, type) values (?, ?, ?, ?)", new object[] { name, address, port, (byte)typeOrdinal }); if (result == 1) { log.InfoFormat("successfully created shard '{0}'", name); } else { log.ErrorFormat("failed to create account '{0}'. expected 1 update, got {1}", name, result); } } } }
protected void Page_Load(object sender, EventArgs e) { UserVM user = AuthServer.GetLoginUser(); int BatchID = 0; int CheckStorage = 0; int Success = 0; int.TryParse(Request.Form["BatchID"], out BatchID); DataSet ds = new DataSet(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("usp_VaccineIn_xDeleteVaccineInBatchData", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", BatchID); cmd.Parameters.AddWithValue("@Account", user.ID); SqlParameter sp = cmd.Parameters.AddWithValue("@CheckStorage", CheckStorage); SqlParameter sp1 = cmd.Parameters.AddWithValue("@Success", Success); sp.Direction = ParameterDirection.Output; sp1.Direction = ParameterDirection.Output; sc.Open(); cmd.ExecuteNonQuery(); CheckStorage = (int)sp.Value; Success = (int)sp1.Value; } } Dictionary <string, int> dict = new Dictionary <string, int>(); dict.Add("Success", Success); dict.Add("CheckStorage", CheckStorage); Response.ContentType = "application/json; charset=utf-8"; Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(dict)); Response.End(); }
public static void WebStart(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime) { SignumServer.Start(app, env, typeof(Startup).Assembly); AuthServer.Start(app, () => Starter.Configuration.Value.AuthTokens, "IMPORTANT SECRET FROM Southwind. CHANGE THIS STRING!!!"); CacheServer.Start(app); FilesServer.Start(app); UserQueryServer.Start(app); DashboardServer.Start(app); WordServer.Start(app); ExcelServer.Start(app); ChartServer.Start(app); MapServer.Start(app); ToolbarServer.Start(app); TranslationServer.Start(app, new AlreadyTranslatedTranslator(new AzureTranslator("Your API Key for Azure Translate"))); SchedulerServer.Start(app, lifetime); ProcessServer.Start(app); MailingServer.Start(app); ProfilerServer.Start(app); DiffLogServer.Start(app); RestServer.Start(app); RestLogServer.Start(app); PredictorServer.Start(app); WorkflowServer.Start(app); DynamicServer.Start(app); OmniboxServer.Start(app, new EntityOmniboxResultGenenerator(), new DynamicQueryOmniboxResultGenerator(), new ChartOmniboxResultGenerator(), new DashboardOmniboxResultGenerator(DashboardLogic.Autocomplete), new UserQueryOmniboxResultGenerator(UserQueryLogic.Autocomplete), new UserChartOmniboxResultGenerator(UserChartLogic.Autocomplete), new MapOmniboxResultGenerator(type => OperationLogic.TypeOperations(type).Any()), new ReactSpecialOmniboxGenerator() //new HelpModuleOmniboxResultGenerator(), ); //Omnibox SignumCultureSelectorFilter.GetCurrentCulture = (ctx) => GetCulture(ctx); }
protected void Page_Load(object sender, EventArgs e) { UserVM user = AuthServer.GetLoginUser(); string PageType; int ID; int SelectID; PageType = Request.Form["Page"]; int.TryParse(Request.Form["ID"], out ID); int.TryParse(Request.Form["SelectID"], out SelectID); DataSet ds = new DataSet(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("usp_StockManagementM_xGetVaccineBatch", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageType", PageType); cmd.Parameters.AddWithValue("@DataID", ID); cmd.Parameters.AddWithValue("@VaccID", SelectID); cmd.Parameters.AddWithValue("@OrgID", user.OrgID); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(ds); } } } List <ChooseVaccineBatchVM> list = new List <ChooseVaccineBatchVM>(); AnyDataVM rtn = new AnyDataVM(); EntityS.FillModel(list, ds.Tables[0]); rtn.message = list; Response.ContentType = "application/json; charset=utf-8"; Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn)); Response.End(); }
static void Main(string[] args) { var server = new AuthServer(); if (!Debugger.IsAttached) { try { server.Initialize(); server.Start(); GC.Collect(); while (true) { Thread.Sleep(5000); } } catch (Exception e) { server.HandleCrashException(e); } finally { server.Shutdown(); } } else { server.Initialize(); server.Start(); GC.Collect(); while (true) { Thread.Sleep(5000); } } }
public static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; AppDomain.CurrentDomain.ProcessExit += ProcessExitHandler; foreach (string arg in args) { if (StringCompare.Equals(arg, "-debug")) { _debug = true; } } Logger.Seperator(); Logger.Info("ServTK - [http://servtk.com]"); string arguments = Arguments; if (arguments.Length > 0) { Logger.Info("Running with: {0}", arguments); } Logger.Seperator(); Logger.Info("Loading Configuration Files"); Logger.Log("Auth server IP = " + Config.Settings.Auth.Ip); Logger.Info("Finished Loading Configuration Files"); Logger.Info("Acquiring Authentication Server"); _authServer = (AuthServer)Server.Acquire(typeof(AuthServer)); Logger.Info("Initializing Authentication Server"); _authServer.Initialize(); Logger.Info("Starting Authentication Server"); _authServer.Thread.Start(); Console.ReadLine(); }
protected void btnLogout_Click(object sender, EventArgs e) { var user = AuthServer.GetLoginUser(); int Chk = 0; Dictionary <string, object> OutDict = new Dictionary <string, object>() { { "@Chk", Chk } }; MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_SystemM_xUpdateLogoutDate" , ref OutDict , new Dictionary <string, object>() { { "@UserID", user.ID }, { "@LoginDate", user.LoginDate }, { "@SystemPowerCateID", SystemPowerCateID } }); Chk = (int)OutDict["@Chk"]; string script = ""; //if (Chk > 0) //{ // Session.Abandon(); // Session.Clear(); // script = "<script>window.parent.location.href='/Login.aspx';</script>"; //} //else //{ // script = "<script>alert('登出失敗');window.parent.onbeforeunload = function () {return '請由\"登出\"按鈕,登出系統';};</script>"; //} Session.Abandon(); Session.Clear(); script = "<script>window.parent.location.href='/Login.aspx';</script>"; Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "GoLogout", script, false); }
protected void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET"); base.DisableTop(false); SearchPower = base.GetPower(PowerList[0]); AddPower = base.GetPower(PowerList[1]); UpdatePower = base.GetPower(PowerList[2]); OrgName = AuthServer.GetLoginUser().OrgName; MyRoleData = JsonConvert.SerializeObject(SystemRole.list.Where(item => item.RoleName != null)); if (SystemCode.dict.ContainsKey("AccountM_EnableState")) { MyEnableData = JsonConvert.SerializeObject(SystemCode.dict["AccountM_EnableState"].Where(item => item.EnumName != null)); } if (SystemCode.dict.ContainsKey("AccountM_CheckState")) { MyCheckData = JsonConvert.SerializeObject(SystemCode.dict["AccountM_CheckState"].Where(item => item.EnumName != null)); } if (SystemCode.dict.ContainsKey("AccountM_LogoutPeriod")) { MyLogoutData = JsonConvert.SerializeObject(SystemCode.dict["AccountM_LogoutPeriod"].Where(item => item.EnumName != null)); } if (SystemCode.dict.ContainsKey("AccountM_AccountCheck2_CheckResult")) { MyCheckResultData = JsonConvert.SerializeObject(SystemCode.dict["AccountM_AccountCheck2_CheckResult"].Where(item => item.EnumName != null)); } if (SystemCode.dict.ContainsKey("AccountM_AccountCheck2_YearSeason")) { MyYearSeasonData = JsonConvert.SerializeObject(SystemCode.dict["AccountM_AccountCheck2_YearSeason"].Where(item => item.EnumName != null)); } }
protected void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); base.DisableTop(false); base.BodyClass = "class='bodybg'"; user = AuthServer.GetLoginUser(); user2 = new UserVM(); if (this.IsPostBack == false) { DataTable dt = new DataTable(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnUser"].ToString())) { using (SqlCommand cmd = new SqlCommand("dbo.usp_AccountM_xGetUserInfoByID", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserID", user.ID); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(dt); } } } EntityS.FillModel(user2, dt); lblAccount.Text = user.LoginName; tbDept.Text = user.RoleName; tbIDF.Text = user2.RocID; tbName.Text = user2.UserName; tbEmail.Text = user2.Email; tbTitle.Text = user2.Title; tbTel.Text = user2.PhoneNumber; } }
protected void Page_Load(object sender, EventArgs e) { UserVM user = AuthServer.GetLoginUser(); int VaccineID = 0; int BatchType = 0; int.TryParse(Request.Form["VaccineID"], out VaccineID); int.TryParse(Request.Form["BatchType"], out BatchType); DataSet ds = new DataSet(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("usp_VaccineIn_xGetSelectData1", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@OrgType", 2); cmd.Parameters.AddWithValue("@OrgID", user.OrgID); cmd.Parameters.AddWithValue("@VaccineID", VaccineID); cmd.Parameters.AddWithValue("@BatchType", BatchType); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(ds); } } } StockManagementSelectVM rtn = new StockManagementSelectVM(); if (ds.Tables.Count > 0) { rtn.BatchIDInfo = ds.Tables[0]; } Response.ContentType = "application/json; charset=utf-8"; Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn)); Response.End(); }
protected new void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET"); base.DisableTop(true); SearchPower = base.GetPower(PowerList[0]); AddPower = base.GetPower(PowerList[1]); UploadPower = base.GetPower(PowerList[2]); var user = AuthServer.GetLoginUser(); UC_OpenSelectSingleOrg.PageUrl = "/Vaccination/RecordM/StudentReRecord.aspx"; UC_OpenSelectSingleOrg.DefaultID = user.OrgID; UC_OpenSelectSingleOrg.DefaultName = user.OrgName; DefaultOrgID = user.OrgID; DefaultOrgName = user.OrgName; if (SystemElementarySchool.list.Count > 0) { sAry = JsonConvert.SerializeObject(SystemElementarySchool.list.Where(item => item.OrgID == user.OrgID)); } }
protected void Page_Load(object sender, EventArgs e) { NewPower = base.AddPower(list[0]); SearchPower = base.AddPower(list[1]); base.AllowHttpMethod("GET", "POST"); base.DisableTop(true); UserVM user = AuthServer.GetLoginUser(); OrgName = string.Format("{0}", user.OrgName); int SelectOrgID = 0; if (user.OrgID == SelectOrgID) { Check = true; } else { Check = false; } }
protected new void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("POST"); base.DisableTop(true); int DefaultBatchVaccineID = GetNumber <int>("d"); if (DefaultBatchVaccineID == 0) { string script = "<script>alert('資料取得失敗');history.go(-1);</script>"; Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false); return; } var user = AuthServer.GetLoginUser(); int Chk = 0; Dictionary <string, object> OutDict = new Dictionary <string, object>() { { "@Chk", Chk } }; MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_ParameterM_xDeleteDefaultVaccineByID" , ref OutDict , new Dictionary <string, object>() { { "@DefaultBatchVaccineID", DefaultBatchVaccineID } }); Chk = (int)OutDict["@Chk"]; OPVM VM = new OPVM(); VM.chk = Chk; Response.ContentType = "application/json; charset=utf-8"; Response.Write(JsonConvert.SerializeObject(VM)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { UserVM user = AuthServer.GetLoginUser(); DataTable dt = new DataTable(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnUser"].ToString())) { using (SqlCommand cmd = new SqlCommand("dbo.usp_PowerM_xGetOrgByOrgID", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@OrgID", user.OrgID); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(dt); } } } List <SystemOrgVM> list = new List <SystemOrgVM>(); EntityS.FillModel(list, dt); if (Convert.ToInt32(WebConfigurationManager.AppSettings["OrgAreaSet"]) == 0) { list.RemoveAll(item => item.OrgLevel == 2); for (var i = 0; i < list.Count; i++) { if (list[i].OrgLevel == 3) { list[i].PID = 1; } } } MyTreeData = JsonConvert.SerializeObject(list.Where(item => item.OrgCateID == Convert.ToInt32(WebConfigurationManager.AppSettings["OrgCateID"]))); }
public static void WebStart(HttpConfiguration config) { SignumServer.Start(config, typeof(Global).Assembly); AuthServer.Start(config, () => Starter.Configuration.Value.AuthTokens, "IMPORTANT SECRET FROM Southwind. CHANGE THIS STRING!!!"); CacheServer.Start(config); FilesServer.Start(config); UserQueryServer.Start(config); DashboardServer.Start(config); WordServer.Start(config); ExcelServer.Start(config); ChartServer.Start(config); MapServer.Start(config); ToolbarServer.Start(config); TranslationServer.Start(config, new AlreadyTranslatedTranslator(new AzureTranslator("Your API Key for Azure Translate"))); SchedulerServer.Start(config); ProcessServer.Start(config); DisconnectedServer.Start(config); MailingServer.Start(config); ProfilerServer.Start(config); DiffLogServer.Start(config); PredictorServer.Start(config); WorkflowServer.Start(config); DynamicServer.Start(config); OmniboxServer.Start(config, new EntityOmniboxResultGenenerator(), new DynamicQueryOmniboxResultGenerator(), new ChartOmniboxResultGenerator(), new DashboardOmniboxResultGenerator(DashboardLogic.Autocomplete), new UserQueryOmniboxResultGenerator(UserQueryLogic.Autocomplete), new UserChartOmniboxResultGenerator(UserChartLogic.Autocomplete), new MapOmniboxResultGenerator(type => OperationLogic.TypeOperations(type).Any()), new ReactSpecialOmniboxGenerator() //new HelpModuleOmniboxResultGenerator(), ); //Omnibox SignumAuthenticationFilterAttribute.GetCurrentCultures = (ac) => GetCulture(ac.Request); }
protected void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); if (Request.HttpMethod.Equals("POST")) { int ID = GetNumber <int>("i"); DownloadVM VM = new DownloadVM(ID); var user = AuthServer.GetLoginUser(); DataTable dt = GetDataTable("ConnDB", "dbo.usp_FileM_xGetFileInfoByID" , new Dictionary <string, object>() { { "@ID", VM.ID }, { "@OrgID", user.OrgID } }); if (dt.Rows.Count > 0) { string Json = JsonConvert.SerializeObject(VM); string code = QueryStringEncryptToolS.Encrypt(Json); Response.Redirect("http://niis_fs.hyweb.com.tw/livestorage.aspx?o=" + HttpUtility.UrlEncode(code)); //Response.Redirect("http://localhost:64351/livestorage.aspx?o=" + HttpUtility.UrlEncode(code)); Response.End(); } else { Response.Redirect("~/html/ErrorPage/NoPower.html"); } } else { Response.Write(""); Response.End(); } }
protected new void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); if (Request.HttpMethod.Equals("POST")) { int ID = 0; int.TryParse(QueryStringEncryptToolS.Decrypt(GetString("i")), out ID); DownloadVM VM = new DownloadVM(ID); var user = AuthServer.GetLoginUser(); //DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_FileM_xGetFileInfoByID" // , new Dictionary<string, object>() // { // { "@ID", VM.ID }, // { "@OrgID", user.OrgID } // }); //if (dt.Rows.Count > 0) //{ string Json = JsonConvert.SerializeObject(VM); string code = QueryStringEncryptToolS.Encrypt(Json); Response.Write("<script>window.open('" + WebConfigurationManager.AppSettings["FileServerURL"] + "/livestorage.aspx?o=" + HttpUtility.UrlEncode(code) + "','_blank');</script>"); Response.End(); //} //else //{ // Response.Redirect("~/html/ErrorPage/NoPower.html"); //} } else { Response.Write(""); Response.End(); } }
protected new void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); base.DisableTop(true); user = AuthServer.GetLoginUser(); DefaultOrgID = user.OrgID; UC_OpenSelectSingleOrg.PageUrl = "/Vaccination/CertificateM/SignSetting.aspx"; UC_OpenSelectSingleOrg.DefaultID = user.OrgID; UC_OpenSelectSingleOrg.DefaultName = user.OrgName; UC_OpenSelectSingleOrg.callback = "onSelectSingleOrg();"; if (this.IsPostBack == false) { DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_RecordM_xGetCertificateSignByOrgID" , new Dictionary <string, object>() { { "@OrgID", user.OrgID } }); if (dt.Rows.Count > 0) { CertificateSignVM VM = new CertificateSignVM(); EntityS.FillModel(VM, dt); tbP.Text = VM.PhysicianSignature; tbE.Text = VM.EnglishFullTitle; tbC.Text = VM.ChineseFullTitle; tbD.Text = VM.UnitDirector; tbS.Text = VM.UnitStamp; UC_OpenSelectSingleOrg.DefaultName = VM.OrgName; UC_OpenSelectSingleOrg.DefaultID = VM.OrgID; //tbLocation.Text = VM.OrgName; //hfLocationID.Value = VM.OrgID.ToString(); } } }
protected new void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); if (Request.HttpMethod.Equals("POST")) { int ID = GetNumber <int>("i"); DownloadVM VM = new DownloadVM(ID); var user = AuthServer.GetLoginUser(); DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_FileM_xGetFileInfoByID" , new Dictionary <string, object>() { { "@ID", VM.ID }, { "@RoleID", user.RoleID }, }); if (dt.Rows.Count > 0) { string Json = JsonConvert.SerializeObject(VM); string code = QueryStringEncryptToolS.Encrypt(Json); Response.Redirect(WebConfigurationManager.AppSettings["FileServerURL"] + "/livestorage.aspx?o=" + HttpUtility.UrlEncode(code)); Response.End(); } else { Response.Redirect("~/html/ErrorPage/NoPower.html"); } } else { Response.Write(""); Response.End(); } }
private bool ProcessAuthServer(AuthServer authServer) { bool result = false; AuthMetadata authMetadata = this.FetchMetadata(authServer.Name, authServer.AuthMetadataUrl, true); if (authMetadata == null) { return(false); } AuthMetadataParser.SetEndpointsIfWSFed(authMetadata, authServer.Type, authServer.AuthMetadataUrl); if (!OAuthCommon.IsIdMatch(authServer.IssuerIdentifier, authMetadata.ServiceName) || !OAuthCommon.IsRealmMatchIncludingEmpty(authServer.Realm, authMetadata.Realm) || string.IsNullOrEmpty(authMetadata.IssuingEndpoint) || ((authServer.Type == AuthServerType.AzureAD || authServer.Type == AuthServerType.ADFS) && string.IsNullOrEmpty(authMetadata.AuthorizationEndpoint))) { this.Context.Logger.LogTerseEvent(MigrationEventType.Error, MSExchangeAuthAdminEventLogConstants.Tuple_InvalidTrustedIssuerChanges, new string[] { authServer.Name, authServer.AuthMetadataUrl }); return(false); } if (string.Compare(authServer.TokenIssuingEndpoint, authMetadata.IssuingEndpoint, StringComparison.OrdinalIgnoreCase) != 0) { result = true; authServer.TokenIssuingEndpoint = authMetadata.IssuingEndpoint; } if ((authServer.Type == AuthServerType.AzureAD || authServer.Type == AuthServerType.ADFS) && string.Compare(authServer.AuthorizationEndpoint, authMetadata.AuthorizationEndpoint, StringComparison.OrdinalIgnoreCase) != 0) { result = true; authServer.AuthorizationEndpoint = authMetadata.AuthorizationEndpoint; } MultiValuedProperty <byte[]> multiValuedProperty = null; if (this.ProcessCertificates(authServer.Name, authServer.CertificateBytes, authMetadata.CertificateStrings, out multiValuedProperty) && multiValuedProperty != null) { result = true; authServer.CertificateBytes = multiValuedProperty; } return(result); }
protected void Delete_Click(object sender, EventArgs e) { UserVM user = AuthServer.GetLoginUser(); int ID = 0; int Success = 0; string script = ""; int.TryParse(Request.QueryString["CheckID"], out ID); DataSet ds = new DataSet(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("usp_NewsPublished_xDeleteNewsPublished", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", ID); cmd.Parameters.AddWithValue("@ModifyAccount", user.ID); SqlParameter sp = cmd.Parameters.AddWithValue("@Success", Success); sp.Direction = ParameterDirection.Output; sc.Open(); cmd.ExecuteNonQuery(); Success = (int)sp.Value; } } if (Success > 0) { script = "<script>alert('刪除成功');location.href = '/System/ElectronBulletinM/NewsPublished/NewsPublished.aspx';</script>"; } else { script = "<script>alert('刪除失敗');</script>"; } Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "alert", script, false); }
protected void Page_Load(object sender, EventArgs e) { UserVM user = AuthServer.GetLoginUser(); int Status = 0; if (SearchPower.HasPower == true) { int.TryParse(Request.Form["Status"], out Status); } DataSet ds = new DataSet(); using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString())) { using (SqlCommand cmd = new SqlCommand("usp_OrgVaccSet_xGetVaccine", sc)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@OrgID", user.OrgID); cmd.Parameters.AddWithValue("@Status", Status); cmd.Parameters.AddWithValue("@CreateAccount", user.ID); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { sc.Open(); da.Fill(ds); } } } List <OrgVaccSet> list = new List <OrgVaccSet>(); AnyDataVM rtn = new AnyDataVM(); EntityS.FillModel(list, ds.Tables[0]); rtn.message = list; Response.ContentType = "application/json; charset=utf-8"; Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { base.AllowHttpMethod("GET", "POST"); base.DisableTop(true); base.BodyClass = "class='bodybg'"; user = AuthServer.GetLoginUser(); if (this.IsPostBack == false) { tbOrg.Text = user.OrgName; int nowYear = DateTime.Now.Year - 1911; ddlYear.Items.Add(new ListItem(nowYear.ToString() + "年", nowYear.ToString())); ddlYear.Items.Add(new ListItem((nowYear + 1).ToString() + "年", (nowYear + 1).ToString())); ddlSeason.Items.Add(new ListItem("第一季", "1")); ddlSeason.Items.Add(new ListItem("第二季", "2")); ddlSeason.Items.Add(new ListItem("第三季", "3")); ddlSeason.Items.Add(new ListItem("第四季", "4")); } }