protected void btnLogin_Click(object sender, ImageClickEventArgs e) { if (txtUserName.Text == "" || txtPassword.Text == "") { ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('输入信息完整!');</script>"); return; } DataTable dt = MyManager.GetDataSet("SELECT UserList.*, Corps.CorpName,Corps.CorpType,Corps.ParentID FROM UserList left join Corps on UserList.CorpID = Corps.CorpID Where UserName = '******' And Pwd = '" + System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "MD5").ToUpper() + "'"); if (dt.Rows.Count == 0) { ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('认证失败!');</script>"); return; } Session["UserID"] = dt.Rows[0]["ID"]; Session["Name"] = dt.Rows[0]["Name"]; Session["LoginTime"] = DateTime.Now.ToString("HH:mm:ss"); Session["UserType"] = dt.Rows[0]["UserType"]; Session["CorpName"] = dt.Rows[0]["CorpName"]; Session["CorpID"] = dt.Rows[0]["CorpID"]; Session["CorpType"] = dt.Rows[0]["CorpType"]; Session["CorpParentID"] = dt.Rows[0]["ParentID"]; Response.Redirect("Main.aspx"); }
private void ZacniPlanovatCestujucich() { MyMessage sprava = new MyMessage(MySim); sprava.Addressee = FindAssistant(SimId.PlanovacPrichodov); MyManager.StartContinualAssistant(sprava); }
public void DefaultValues() { // FIXME: check more MyManager mgr = new MyManager(); Assert.IsTrue(mgr.ServiceCredentials.SecureConversationAuthentication.SecurityStateEncoder is DataProtectionSecurityStateEncoder, "#n-1"); }
protected void Page_Load(object sender, EventArgs e) { String txtUserName = "", txtPassword = "", json = "{}"; StringWriter sw = new StringWriter(); JsonWriter jWrite = new JsonTextWriter(sw); StreamReader reader = new StreamReader(Request.InputStream); json = reader.ReadToEnd(); try { JObject JO = JObject.Parse(json); txtUserName = JO["username"].ToString(); txtPassword = JO["pwd"].ToString(); /*Response.Write("dat:" +json+"\n"); * Response.Write("parse:" + txtUserName + txtPassword + "\n"); * Response.Write("response:");*/ if (txtUserName == "" || txtPassword == "") { json = "{\"status\":\"failed\",\"Msg\":\"请输入用户名和密码!\"}"; Response.Write(json); return; } //Response.Write("h1\n"); DataTable dt = MyManager.GetDataSet("SELECT UserList.*, Corps.CorpName,Corps.CorpType,Corps.ParentID FROM UserList left join Corps on UserList.CorpID = Corps.CorpID Where UserName = '******' And Pwd = '" + System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword, "MD5").ToUpper() + "'"); // Response.Write("h2\n"); if (dt.Rows.Count == 0) { json = "{\"status\":\"failed\",\"Msg\":\"密码错误!\"}"; Response.Write(json); } // Response.Write("h3\n") Session["UserID"] = dt.Rows[0]["ID"]; Session["Name"] = dt.Rows[0]["Name"]; Session["LoginTime"] = DateTime.Now.ToString("HH:mm:ss"); Session["UserType"] = dt.Rows[0]["UserType"]; Session["CorpName"] = dt.Rows[0]["CorpName"]; Session["CorpID"] = dt.Rows[0]["CorpID"]; Session["CorpType"] = dt.Rows[0]["CorpType"]; Session["CorpParentID"] = dt.Rows[0]["ParentID"]; json = "{\"status\":\"success\",\"url\":\"Main.aspx\"}"; Response.Write(json); } catch (Exception ee) { json = "{\"status\":\"failed\",\"Msg\":\"" + ee.ToString() + "\"}"; } //Response.Redirect("RealMain.aspx"); }
protected void Button2_Click1(object sender, EventArgs e) { String Content = Server.HtmlEncode(Request.Form["content1"].ToString()); if (TextBox1.Text == "") { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>showDlg('还没有输入标题呢。。');</script>"); return; } if (MyManager.ExecSQL("INSERT INTO TaskComments ([TargetID],[TaskID],[UserID] ,[Type] ,[Title],[Content] ,[DateTime]) Values ('" + "0','" + TaskID + "','" + Session["UserID"].ToString() + "','1','" + TextBox1.Text + "','" + Content.Replace("'", "'") + "','" + DateTime.Now.ToString() + "')") == 1) { // Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>CloseArtDialog();</script>"); Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>CloseMeOnshowDlg('发布成功!');</script>"); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>showDlg('发布失败!');</script>"); } }
private void ButtonCell_Click(object sender, RoutedEventArgs e) { Button btnSender = ((Button)sender); int configId = ((ConfigItem)dgData.SelectedValue).Entity.Id; switch (btnSender.CommandParameter.ToString()) { case "start": if (MyApplication.isListening(configId)) { MyApplication.stopListen(configId); btnSender.Content = "启动"; } else { MyApplication.startListen(configId); btnSender.Content = "停止"; } break; case "edit": var page = new Page_EditProxy(); page.Id = configId; NavigationService.Navigate(page); break; case "delete": MyManager.DeleteProxyServer(configId); loadData(); break; } }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { entity.LocalPort = int.Parse(this.txtLocalPort.Text); entity.Server = this.txtServer.Text; MyManager.SaveProxyServer(entity); NavigationService.GoBack(); }
private void axZKFPEngX1_OnEnroll(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollEvent e) { byte[] tmpbyte; string tmp = ""; tmp = gZK.GetTemplateAsString(); textBox1.Text = tmp; if (MyManager.InsertFingerTmp(((NodeTag)CurNode.Tag).UserID, tmp, (byte[])e.aTemplate, GetImageBytes(pictureBox1.Image)) == true) { MessageBox.Show("指纹登记成功!"); textBox2.Text = "指纹登机成功!"; NodeTag nt = (NodeTag)CurNode.Tag; nt.HaveFingerTmp = 1; CurNode.Text = nt.UserName + "(Y)"; CurNode.ForeColor = Color.Black; } else { MessageBox.Show("指纹登记失败!"); textBox2.Text = "指纹登机失败!"; } button1.Enabled = true; button3.Enabled = false; //tmpbyte = Convert.FromBase64String(tmp); //开始检查指纹是否重复 //DataTable dt = MyManager.GetDataSet("SELECT UserName,UserID,FingerTmp From UserList Where UserID <>" + ((NodeTag)CurNode.Tag).UserID + " AND "); }
override public void PrepareReplication() { base.PrepareReplication(); // Setup component for the next replication //SelectedCars = FormAgentSimulation.SelectedCars; MyMessage sprava = new MyMessage(MySim, SelectedCars); /* Hard setup of cars * int[] selectedCars = new int[5]; * selectedCars[0] = 1; * selectedCars[1] = 1; * selectedCars[2] = 1; * selectedCars[3] = 1; * selectedCars[4] = 1; */ //int[] selectedCars = new int[5] { 0, 20, 0, 0, 0 }; // MyMessage sprava = new MyMessage(MySim, selectedCars); sprava.Code = Mc.Inicializacia; sprava.Addressee = MySim.FindAgent(SimId.AgentModelu); MyManager.Call(sprava); }
void CreateTree(TreeView tv) { String NodeName; DataTable dt = MyManager.GetDataSet("select ID,name,(case when FingerTmpStr is null then 0 when FingerTmpStr IS not null then 1 end) as sign from userlist order by Name asc"); TreeNode p_node = tv.Nodes.Add("全体人员"); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["sign"].ToString() == "0") { NodeName = dt.Rows[i]["Name"].ToString() + "(N)"; } else { NodeName = dt.Rows[i]["Name"].ToString() + "(Y)"; } NodeTag nt = new NodeTag(); nt.UserName = dt.Rows[i]["Name"].ToString(); nt.UserID = dt.Rows[i]["ID"].ToString(); nt.HaveFingerTmp = Convert.ToInt32(dt.Rows[i]["sign"].ToString()); TreeNode node = new TreeNode(NodeName); node.Tag = nt; if (nt.HaveFingerTmp == 0) { node.ForeColor = Color.Red; } p_node.Nodes.Add(node); } p_node.Expand(); //tv.Nodes.Add(p_node); }
void MouseMoveEx(object sender, MouseEventArgs e) { if ((e.Button & MouseButtons.Left) != 0) { if (MouseDownItem != null) { Point p = Control.MousePosition; p.Offset(-MouseDownPoint.X, -MouseDownPoint.Y); if (Math.Abs(p.X) > 4 || Math.Abs(p.Y) > 4) { MyManager.SetCustomizeSelectedLink(null); MyManager.SetSelectedItem(MouseDownItem); BarManagerHelpers helper = MyManager.GetHelper(); try { MouseDraggingItem = MouseDownItem; this.ControlForDrag.GetControlToPerformDragging(Control.MousePosition).AllowDrop = true; helper.DragManager.UseDefaultCursors = true; helper.DragManager.StartDragging(null, e, MouseDownItem, this.ControlForDrag.GetControlToPerformDragging(Control.MousePosition)); } finally { helper.DragManager.UseDefaultCursors = false; this.ControlForDrag.GetControlToPerformDragging(Control.MousePosition).AllowDrop = false; MyManager.SetSelectedItem(null); MouseDraggingItem = null; } } } } }
public void UpdateKeyLabels(MyManager mm) { Control c = mm.GetControl(this.key); this.kb.GetComponentInChildren <Text> ().text = c.key.ToString(); this.jk.GetComponentInChildren <Text> ().text = c.joyName.ToString(); }
protected void Button1_Click(object sender, EventArgs e) { if (false == VerifyTask(TaskID)) { Button1.Visible = false; lb.Text = "无权限转出!请关闭窗口!"; return; } if (DropDownList1.Text == "") { return; } String RecvCorpID = DropDownList1.SelectedItem.Value; MyManager.ExecSQL("DELETE FROM TaskProcess WHERE TaskID=" + TaskID + " AND RecvCorpID IN (SELECT CorpID FROM Corps WHERE ParentID = " + Session["CorpParentID"].ToString() + ") "); FlowTask(TaskID, RecvCorpID); MyManager.WriteTaskFlow(TaskID, Session["UserID"].ToString(), Session["CorpID"].ToString(), RecvCorpID, TextBox1.Text, DateTime.Now.ToString()); MyManager.ExecSQL("UPDATE Tasks Set Memo='" + TextBox1.Text + "',State = 1,SendCorpID=" + Session["CorpParentID"].ToString() + ",RecvCorpID=" + RecvCorpID + " WHERE ID = " + TaskID); MyManager.ExecSQL("INSERT INTO TaskLog (TaskID,CreateUserName,CreateUserID,Title,Content,DateTime) Values ('" + TaskID + "','" + Session["Name"].ToString() + "'," + Session["UserID"].ToString() + ",'任务转发','接收部门:" + DropDownList1.SelectedItem.Text + RecvUserName + "','" + DateTime.Now.ToString() + "')"); lb.Text = "任务已转发至->" + DropDownList1.SelectedItem.Text + "!"; Label1.Visible = false; Label2.Visible = false; TextBox1.Visible = false; DropDownList1.Visible = false; Button1.Visible = false; //Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>art.dialog({ id: 'dg_test34243' }).close();</script>"); // Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>tDialog();</script>"); }
public async Task UnitTests_MyManagerMock() { var receiptEngineMock = new Mock <IMyEngine>(); receiptEngineMock.Setup(x => x.TestMe(It.IsAny <string>())).Returns((string s) => Task.FromResult($"{s} MOCKED ENGINE")); var receiptAccessorMock = new Mock <IMyAccessor>(); receiptAccessorMock.Setup(x => x.TestMe(It.IsAny <string>())).Returns((string s) => Task.FromResult($"{s} MOCKED ACCESSOR")); var myManager = new MyManager(new UserContext() { UserName = "******" }, null, null); myManager.AccessorServiceProvider.OverrideService <IMyAccessor>(receiptAccessorMock.Object); myManager.EngineServiceProvider.OverrideService <IMyEngine>(receiptEngineMock.Object); var result = await myManager.TestMe("test"); Assert.IsTrue(result.Contains("MOCKED ENGINE")); Assert.IsTrue(result.Contains("MOCKED ACCESSOR")); receiptEngineMock.Verify(a => a.TestMe(It.IsAny <string>()), Times.Once()); receiptAccessorMock.Verify(a => a.TestMe(It.IsAny <string>()), Times.Once()); }
protected void OutBtn_Click(object sender, EventArgs e) { int i = 0; Button Btn = (Button)sender; String txt = Btn.Text; String TaskID = ""; String RealTaskProcessState = "", RowIndex = "", GVTaskProcessState = ""; String[] Arr = Btn.CommandArgument.Split('|'); DataTable dt; String Msg = "", Title = ""; TaskID = Arr[0]; RowIndex = Arr[1]; GVTaskProcessState = Arr[2]; RealTaskProcessState = MyManager.GetFiledByInput("SELECT top 1 State FROM TaskProcess WHERE TaskID = " + TaskID + " AND RecvUser="******"UserID"].ToString(), "State"); if (RealTaskProcessState != GVTaskProcessState) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>showDlg('任务状态有更新,请重新查看!');</script>"); return; } Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='JavaScript'>showDialogByUrl('CorpsSelect.aspx?TaskID=" + TaskID + "','TaskManage.aspx');</script>"); // GV2Bind(); }
public CongregationPortalController(ICongregationRepository congregation, IMapper mapper, MyManager userManager) { _congregation = congregation; _mapper = mapper; _userManager = userManager; }
public UserRolesController(MyRoles userRole, MyManager userManager, IMapper Mapper) { _userRole = userRole; _userManager = userManager; _mapper = Mapper; }
static void Main(string[] args) { App.VSync = true; App.Title = "Pong game by VSKA"; App.Fullscreen = true; StateManager MyManager = new MyManager(new Game()); App.Run(MyManager); }
public PublisherController(MyManager userManager, IPublishersRepository publishers, IMapper Mapper) { _userManager = userManager; _publishers = publishers; _mapper = Mapper; }
public PublisherServiceGroupController(IServiceGroupsRepository ServiceGroup, MyManager userManager, IMapper Mapper) { _serviceGroup = ServiceGroup; _userManager = userManager; _mapper = Mapper; }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { cfgServer.MyVal = this.txtServer.Text; cfgUserToken.MyVal = this.txtUserToken.Text; MyManager.SaveConfig(cfgServer); MyManager.SaveConfig(cfgUserToken); NavigationService.GoBack(); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } MyManager.FillList(DropDownList1, "SELECT TypeName,(Convert(varchar(4),TypeID) + '|' + TypeCode) AS Value FROM [TaskTypes]", "TypeName", "Value", true); }
// Use this for initialization void Start() { if (myManager == null) { myManager = GameObject.Find("GameManager").GetComponent <MyManager> (); } menu = myManager.GetControl("menu_button"); trigger = myManager.GetControl("trigger_button"); CloseAll(); }
public AccountController(MyManager userManager, SignInManager <ApplicationUser> signInManager, IEmailSenderExtensions emailSender, ILogger <AccountController> logger) { this.userManager = userManager; this.signInManager = signInManager; this.emailSender = emailSender; this.logger = logger; }
public void IsIssuedSecurityTokenRequirement() { RecipientServiceModelSecurityTokenRequirement r; MyManager mgr = new MyManager(); r = new RecipientServiceModelSecurityTokenRequirement(); MySslSecurityTokenParameters ssl = new MySslSecurityTokenParameters(); ssl.InitRequirement(r); Assert.IsFalse(mgr.IsIssued(r), "ssl"); r = new RecipientServiceModelSecurityTokenRequirement(); MySspiSecurityTokenParameters sspi = new MySspiSecurityTokenParameters(); sspi.InitRequirement(r); Assert.IsFalse(mgr.IsIssued(r), "sspi"); r = new RecipientServiceModelSecurityTokenRequirement(); MyIssuedSecurityTokenParameters issued = new MyIssuedSecurityTokenParameters(); issued.InitRequirement(r); Assert.IsTrue(mgr.IsIssued(r), "issued"); /* * r = new RecipientServiceModelSecurityTokenRequirement (); * MySecureConversationSecurityTokenParameters sc = * new MySecureConversationSecurityTokenParameters ( * new SymmetricSecurityBindingElement (new X509SecurityTokenParameters ()), * false, * new ChannelProtectionRequirements ()); * r.Properties [ReqType.IssuerBindingContextProperty] = * new BindingContext (new CustomBinding (), new BindingParameterCollection ()); * r.Properties [ReqType.MessageSecurityVersionProperty] = * MessageSecurityVersion.Default; * r.Properties [ReqType.ChannelParametersCollectionProperty] = * new ChannelParameterCollection (); * r.Properties [ReqType.IssuedSecurityTokenParametersProperty] = sc.Clone (); * r.Properties [ReqType.IssuerBindingProperty] = * new CustomBinding (new HttpTransportBindingElement ()); * r.Properties [ReqType.MessageDirectionProperty] = * MessageDirection.Input; * r.SecureConversationSecurityBindingElement = * new SymmetricSecurityBindingElement ( * new X509SecurityTokenParameters ()); * r.SecurityAlgorithmSuite = SecurityAlgorithmSuite.Default; * r.Properties [ReqType.SupportSecurityContextCancellationProperty] = true; * r.ListenUri = new Uri ("http://localhost:8080"); * r.KeySize = 256; * sc.InitRequirement (r); * Assert.IsFalse (mgr.IsIssued (r), "sc"); */ }
override public void PrepareReplication() { base.PrepareReplication(); // Setup component for the next replication var sprava = new Sprava(MySim) { Addressee = this, Code = Mc.NoticeInicializuj }; MyManager.Notice(sprava); }
override public void PrepareReplication() { base.PrepareReplication(); // Setup component for the next replication if (!((MySimulation)MySim).Fast) { MyMessage ms = new MyMessage(MySim); ms.Addressee = FindAssistant(SimId.PlanovacStat); MyManager.StartContinualAssistant(ms); } }
// Use this for initialization void Start() { fireBallScript = (DemoScript)gameObject.GetComponent(typeof(DemoScript)); myManager = (MyManager)GameObject.Find("Network Manager").GetComponent(typeof(MyManager)); commonText = GetComponentInChildren <Text>(); typerText = (Text)GameObject.Find("TyperText").GetComponent(typeof(Text)); labelTag = commonText.text; toType = ""; currentlyCorrect = ""; fireIt = false; }
// Use this for initialization void Start() { myManager = new MyManager(); myManager.BuilderExportOnlyMethod(); GameObject newGO = new GameObject("AGameObject"); newGO.AddComponent <FirstBehavior>(); newGO.transform.SetParent(sceneObjectsRootTransform); }
static public String GetNextID()/*获取下一个工具包前两位编号*/ { String[] arr = { "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; String ID = MyManager.GetFiledByInput("Select Top 1 NextID FROM NextID", "NextID"); int i, j, k, t; if (MyManager.SELCount("SELECT count(ID) as Count FROM CoreTool WHERE ToolID like '" + ID + "%'", "Count") > 0) { if (ID[ID.Length - 1].ToString() == arr[arr.Length - 1])//最后一位字母为字符表中最后一个字母,需要进位 { //开始层层进位 for (i = ID.Length - 1; i >= 0; i--) { if (ID[i].ToString() == arr[arr.Length - 1]) { ID = (i == 0 ? "" : ID.Substring(0, i)) + arr[0] + (i == ID.Length - 1 ? "" : ID.Substring(i + 1, ID.Length - 1 - i)); //ID = ID.Substring(0, i) + arr[0];//某位为最后一个字母则证明前位需要进位,而本位变为第一个字母 } else //碰到不为最后一个字母的,则该位变为下一个字母,然后退出循环即可。 { j = 0; while (ID[i].ToString() != arr[j]) { j++; } ID = (i == 0 ? "" : ID.Substring(0, i)) + arr[j + 1] + (i == ID.Length - 1 ? "" : ID.Substring(i + 1, ID.Length - 1 - i)); break; } } if (i < 0)//需要加位 { ID = arr[0] + ID; } } else { j = 0; while (ID[ID.Length - 1].ToString() != arr[j]) { j++; } ID = ID.Substring(0, ID.Length - 1) + arr[j + 1]; } } MyManager.ExecSQL("Update NextID Set NextID = '" + ID + "' WHERE ID =1"); return(ID); }
Boolean VerifyTask(String TaskID)//审核权限是否为0组 且任务当前部门和本部门一致 { if (Session["UserType"].ToString() != "0") { return(false); //非0组,无转出权限 } if (Session["CorpID"].ToString() != MyManager.GetFiledByInput("SELECT ParentID FROM Corps WHERE CorpID = (SELECT RecvCorpID From Tasks WHERE ID = " + TaskID + ")", "ParentID")) { return(false); } return(true); }
public void IsIssuedSecurityTokenRequirement () { RecipientServiceModelSecurityTokenRequirement r; MyManager mgr = new MyManager (); r = new RecipientServiceModelSecurityTokenRequirement (); MySslSecurityTokenParameters ssl = new MySslSecurityTokenParameters (); ssl.InitRequirement (r); Assert.IsFalse (mgr.IsIssued (r), "ssl"); r = new RecipientServiceModelSecurityTokenRequirement (); MySspiSecurityTokenParameters sspi = new MySspiSecurityTokenParameters (); sspi.InitRequirement (r); Assert.IsFalse (mgr.IsIssued (r), "sspi"); r = new RecipientServiceModelSecurityTokenRequirement (); MyIssuedSecurityTokenParameters issued = new MyIssuedSecurityTokenParameters (); issued.InitRequirement (r); Assert.IsTrue (mgr.IsIssued (r), "issued"); /* r = new RecipientServiceModelSecurityTokenRequirement (); MySecureConversationSecurityTokenParameters sc = new MySecureConversationSecurityTokenParameters ( new SymmetricSecurityBindingElement (new X509SecurityTokenParameters ()), false, new ChannelProtectionRequirements ()); r.Properties [ReqType.IssuerBindingContextProperty] = new BindingContext (new CustomBinding (), new BindingParameterCollection ()); r.Properties [ReqType.MessageSecurityVersionProperty] = MessageSecurityVersion.Default; r.Properties [ReqType.ChannelParametersCollectionProperty] = new ChannelParameterCollection (); r.Properties [ReqType.IssuedSecurityTokenParametersProperty] = sc.Clone (); r.Properties [ReqType.IssuerBindingProperty] = new CustomBinding (new HttpTransportBindingElement ()); r.Properties [ReqType.MessageDirectionProperty] = MessageDirection.Input; r.SecureConversationSecurityBindingElement = new SymmetricSecurityBindingElement ( new X509SecurityTokenParameters ()); r.SecurityAlgorithmSuite = SecurityAlgorithmSuite.Default; r.Properties [ReqType.SupportSecurityContextCancellationProperty] = true; r.ListenUri = new Uri ("http://localhost:8080"); r.KeySize = 256; sc.InitRequirement (r); Assert.IsFalse (mgr.IsIssued (r), "sc"); */ }
public void Initialize () { def_c = new MyManager (); }
public void DefaultValues () { // FIXME: check more MyManager mgr = new MyManager (); Assert.IsTrue (mgr.ServiceCredentials.SecureConversationAuthentication.SecurityStateEncoder is DataProtectionSecurityStateEncoder, "#n-1"); }