public MessageViewModel() { change = new RelayCommand(getdata); Showdata1 = new RelayCommand <DataGrid>(showdata); Gotopage2 = new RelayCommand(gotopage2); Gotopage1 = new RelayCommand(gotopage1); GotoW1 = new RelayCommand(gotopage1); //login = new RelayCommand(showlogin); this.People = Getdata.GetAllPeople(); SqlConnection con = dbconnect.getcon(); SqlCommand cmd = new SqlCommand("select * from mvvmtest where name='maki'", con); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { //p = new Person(); this.p = new Person(); p.Name = reader.GetString(1); p.Age = reader.GetInt32(2); if (reader.GetString(3) == "男") { p.Sex = Sex.Male; } else if (reader.GetString(3) == "女") { p.Sex = Sex.Female; } p.Content = reader.GetString(4); } con.Close(); }
private DsPostVerid GetVer(Getdata gd, int soh) { string Verjson = gd(soh); Posts p = DataSwitch.JsonToObject <Posts>(Verjson); DsPostVerid dpv = DataSwitch.JsonToObject <DsPostVerid>(p.Jsons); return(dpv); }
public ActionResult GetList() { Getdata gd = new Getdata(); IEnumerable <ReportData> data = gd.GetReport(); // return View(data); return(Json(new{ data = data }, JsonRequestBehavior.AllowGet)); }
private List <Posts> GetDiffdata(DsPostVerid sdpv, DsPostVerid ldpv, Getdata gd) { List <Posts> plist = new List <Posts>(); for (int i = ldpv.serid; i <= sdpv.serid; i++) { string postjson = gd(i); Posts p = DataSwitch.JsonToObject <Posts>(postjson); plist.Add(p); } return(plist); }
private void SetTransformState(bool initialize = false) { var creatorTransform = creator.transform; if (!initialize) { if (transformPos != creatorTransform.position || creatorTransform.localScale != transformScale || creatorTransform.rotation != transformRot) { Getdata.PathTransformed(); } } transformPos = creatorTransform.position; transformScale = creatorTransform.localScale; transformRot = creatorTransform.rotation; }
private void DrawVertexPathInspector() { GUILayout.Space(inspectorSectionSpacing); EditorGUILayout.LabelField("Vertex count: " + creator.Path.NumPoints); GUILayout.Space(inspectorSectionSpacing); Getdata.showVertexPathOptions = EditorGUILayout.Foldout(Getdata.showVertexPathOptions, new GUIContent("Vertex Path Options"), true, boldFoldoutStyle); if (Getdata.showVertexPathOptions) { using (var check = new EditorGUI.ChangeCheckScope()) { Getdata.vertexPathMaxAngleError = EditorGUILayout.Slider(new GUIContent("Max Angle Error"), Getdata.vertexPathMaxAngleError, 0, 45); Getdata.vertexPathMinVertexSpacing = EditorGUILayout.Slider(new GUIContent("Min Vertex Dst"), Getdata.vertexPathMinVertexSpacing, 0, 1); GUILayout.Space(inspectorSectionSpacing); if (check.changed) { Getdata.VertexPathSettingsChanged(); SceneView.RepaintAll(); EditorApplication.QueuePlayerLoopUpdate(); } } } Getdata.showVertexPathDisplayOptions = EditorGUILayout.Foldout(Getdata.showVertexPathDisplayOptions, new GUIContent("Display Options"), true, boldFoldoutStyle); if (Getdata.showVertexPathDisplayOptions) { using (var check = new EditorGUI.ChangeCheckScope()) { Getdata.showNormalsInVertexMode = GUILayout.Toggle(Getdata.showNormalsInVertexMode, new GUIContent("Show Normals")); Getdata.showBezierPathInVertexMode = GUILayout.Toggle(Getdata.showBezierPathInVertexMode, new GUIContent("Show Bezier Path")); if (check.changed) { SceneView.RepaintAll(); EditorApplication.QueuePlayerLoopUpdate(); } } DrawGlobalDisplaySettingsInspector(); } }
public override void OnInspectorGUI() { // Initialize GUI styles if (boldFoldoutStyle == null) { boldFoldoutStyle = new GUIStyle(EditorStyles.foldout); boldFoldoutStyle.fontStyle = FontStyle.Bold; } Undo.RecordObject(creator, "Path settings changed"); // Draw Bezier and Vertex tabs var tabIndex = GUILayout.Toolbar(Getdata.tabIndex, tabNames); if (tabIndex != Getdata.tabIndex) { Getdata.tabIndex = tabIndex; TabChanged(); } // Draw inspector for active tab switch (Getdata.tabIndex) { case bezierPathTab: DrawBezierPathInspector(); break; case vertexPathTab: DrawVertexPathInspector(); break; } // Notify of undo/redo that might modify the path if (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed") { Getdata.PathModifiedByUndo(); } }
public static Object[][] getdata() { return(Getdata.getTestdata2(xls, testcaseName)); }
public void TestMethod() { // FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"D:\RNG_Automation", "geckodriver.exe"); // service.FirefoxBinaryPath = @"C:\Program Files\Mozilla Firefox\firefox.exe"; Dictionary <String, String> patient = (Dictionary <String, String>)Getdata.getTestdata2(xls, "Patientdetails")[0][0]; if (patient["AdmType"] == "Direct") { for (int i = 0; i < 1; i++) { Dictionary <String, String> obj = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[i][0]; string user = obj["username"]; string pass = obj["pass"]; Login(user, pass); if (i == 0) { //for (int j = 0; j < Getdata.getTestdata2(xls, "Patientdetails").Length; j++) { Dictionary <String, String> obj1 = (Dictionary <String, String>)Getdata.getTestdata2(xls, "Patientdetails")[i][0]; FillForm(obj1); } } else if (i == 1) { HospitilistAccept(); } if (i == 2) { Bed_ava_arrived(); } else if (i == 3) { Patient_dis(); } Thread.Sleep(3000); Logout(); } //tcc tasks by phanee { Dictionary <String, String> obj1 = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[4][0]; string user1 = obj1["username"]; string pass1 = obj1["pass"]; Login(user1, pass1); TccReroutePhy(); Thread.Sleep(3000); Logout(); } } else if (patient["AdmType"] == "Edreferral") { Dictionary <String, String> obj = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[0][0]; string user = obj["username"]; string pass = obj["pass"]; Login(user, pass); //for (int j = 0; j < Getdata.getTestdata2(xls, "Patientdetails").Length; j++) { Dictionary <String, String> obj1 = (Dictionary <String, String>)Getdata.getTestdata2(xls, "Patientdetails")[0][0]; FillForm(obj1); } Thread.Sleep(3000); Logout(); } else if (patient["AdmType"] == "Phych") { Dictionary <String, String> obj = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[0][0]; string user = obj["username"]; string pass = obj["pass"]; Login(user, pass); //for (int j = 0; j < Getdata.getTestdata2(xls, "Patientdetails").Length; j++) { Dictionary <String, String> obj1 = (Dictionary <String, String>)Getdata.getTestdata2(xls, "Patientdetails")[0][0]; FillForm(obj1); } Thread.Sleep(3000); Logout(); //tcclogin obj = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[4][0]; user = obj["username"]; pass = obj["pass"]; Login(user, pass); TccAccept(); Thread.Sleep(3000); Logout(); //hcat mcat login obj = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[5][0]; user = obj["username"]; pass = obj["pass"]; Login(user, pass); hcatAccept(); Thread.Sleep(3000); Logout(); for (int i = 1; i < 4; i++) { obj = (Dictionary <String, String>)Getdata.getTestdata2(xls, "UserLogin")[i][0]; user = obj["username"]; pass = obj["pass"]; Login(user, pass); if (i == 1) { HospitilistAccept(); } if (i == 2) { Bed_ava_arrived(); } else if (i == 3) { Patient_dis(); } Thread.Sleep(3000); Logout(); } } }
private void DrawBezierPathInspector() { using (var check = new EditorGUI.ChangeCheckScope()) { // Path options: Getdata.showPathOptions = EditorGUILayout.Foldout(Getdata.showPathOptions, new GUIContent("Bézier Path Options"), true, boldFoldoutStyle); if (Getdata.showPathOptions) { GetBezierPath.Space = (PathSpace)EditorGUILayout.Popup("Space", (int)GetBezierPath.Space, spaceNames); GetBezierPath.ControlPointMode = (BezierPath.ControlMode)EditorGUILayout.EnumPopup(new GUIContent("Control Mode"), GetBezierPath.ControlPointMode); if (GetBezierPath.ControlPointMode == BezierPath.ControlMode.Automatic) { GetBezierPath.AutoControlLength = EditorGUILayout.Slider(new GUIContent("Control Spacing"), GetBezierPath.AutoControlLength, 0, 1); } GetBezierPath.IsClosed = EditorGUILayout.Toggle("Closed Path", GetBezierPath.IsClosed); Getdata.showTransformTool = EditorGUILayout.Toggle(new GUIContent("Enable Transforms"), Getdata.showTransformTool); Tools.hidden = !Getdata.showTransformTool; // Check if out of bounds (can occur after undo operations) if (handleIndexToDisplayAsTransform >= GetBezierPath.NumPoints) { handleIndexToDisplayAsTransform = -1; } // If a point has been selected if (handleIndexToDisplayAsTransform != -1) { EditorGUILayout.LabelField("Selected Point:"); using (new EditorGUI.IndentLevelScope()) { var currentPosition = creator.BezierPath[handleIndexToDisplayAsTransform]; var newPosition = EditorGUILayout.Vector3Field("Position", currentPosition); if (newPosition != currentPosition) { Undo.RecordObject(creator, "Move point"); creator.BezierPath.MovePoint(handleIndexToDisplayAsTransform, newPosition); } // Don't draw the angle field if we aren't selecting an anchor point/not in 3d space if (handleIndexToDisplayAsTransform % 3 == 0 && creator.BezierPath.Space == PathSpace.xyz) { var anchorIndex = handleIndexToDisplayAsTransform / 3; var currentAngle = creator.BezierPath.GetAnchorNormalAngle(anchorIndex); var newAngle = EditorGUILayout.FloatField("Angle", currentAngle); if (newAngle != currentAngle) { Undo.RecordObject(creator, "Set Angle"); creator.BezierPath.SetAnchorNormalAngle(anchorIndex, newAngle); } } } } if (Getdata.showTransformTool & (handleIndexToDisplayAsTransform == -1)) { if (GUILayout.Button("Centre Transform")) { var worldCentre = GetBezierPath.CalculateBoundsWithTransform(creator.transform).center; var transformPos = creator.transform.position; if (GetBezierPath.Space == PathSpace.xy) { transformPos = new Vector3(transformPos.x, transformPos.y, 0); } else if (GetBezierPath.Space == PathSpace.xz) { transformPos = new Vector3(transformPos.x, 0, transformPos.z); } var worldCentreToTransform = transformPos - worldCentre; if (worldCentre != creator.transform.position) { if (worldCentreToTransform != Vector3.zero) { var localCentreToTransform = MathUtility.InverseTransformVector(worldCentreToTransform, creator.transform, GetBezierPath.Space); for (int i = 0; i < GetBezierPath.NumPoints; i++) { GetBezierPath.SetPoint(i, GetBezierPath.GetPoint(i) + localCentreToTransform, true); } } creator.transform.position = worldCentre; GetBezierPath.NotifyPathModified(); } } } if (GUILayout.Button("Reset Path")) { Undo.RecordObject(creator, "Reset Path"); var in2DEditorMode = EditorSettings.defaultBehaviorMode == EditorBehaviorMode.Mode2D; Getdata.ResetBezierPath(creator.transform.position, in2DEditorMode); EditorApplication.QueuePlayerLoopUpdate(); } GUILayout.Space(inspectorSectionSpacing); } Getdata.showNormals = EditorGUILayout.Foldout(Getdata.showNormals, new GUIContent("Normals Options"), true, boldFoldoutStyle); if (Getdata.showNormals) { GetBezierPath.FlipNormals = EditorGUILayout.Toggle(new GUIContent("Flip Normals"), GetBezierPath.FlipNormals); if (GetBezierPath.Space == PathSpace.xyz) { GetBezierPath.GlobalNormalsAngle = EditorGUILayout.Slider(new GUIContent("Global Angle"), GetBezierPath.GlobalNormalsAngle, 0, 360); if (GUILayout.Button("Reset Normals")) { Undo.RecordObject(creator, "Reset Normals"); GetBezierPath.FlipNormals = false; GetBezierPath.ResetNormalAngles(); } } GUILayout.Space(inspectorSectionSpacing); } // Editor display options Getdata.showDisplayOptions = EditorGUILayout.Foldout(Getdata.showDisplayOptions, new GUIContent("Display Options"), true, boldFoldoutStyle); if (Getdata.showDisplayOptions) { Getdata.showPathBounds = GUILayout.Toggle(Getdata.showPathBounds, new GUIContent("Show Path Bounds")); Getdata.showPerSegmentBounds = GUILayout.Toggle(Getdata.showPerSegmentBounds, new GUIContent("Show Segment Bounds")); Getdata.displayAnchorPoints = GUILayout.Toggle(Getdata.displayAnchorPoints, new GUIContent("Show Anchor Points")); if (!(GetBezierPath.ControlPointMode == BezierPath.ControlMode.Automatic && globalDisplaySettings.hideAutoControls)) { Getdata.displayControlPoints = GUILayout.Toggle(Getdata.displayControlPoints, new GUIContent("Show Control Points")); } Getdata.keepConstantHandleSize = GUILayout.Toggle(Getdata.keepConstantHandleSize, new GUIContent("Constant Point Size", constantSizeTooltip)); Getdata.bezierHandleScale = Mathf.Max(0, EditorGUILayout.FloatField(new GUIContent("Handle Scale"), Getdata.bezierHandleScale)); DrawGlobalDisplaySettingsInspector(); } if (check.changed) { SceneView.RepaintAll(); EditorApplication.QueuePlayerLoopUpdate(); } } }