private void btnLogin_Click(object sender, EventArgs e) { if (IsValid()) { using (SqlConnection con = new SqlConnection(Application_Settings.ConnectionString())) { using (SqlCommand cmd = new SqlCommand("usp_Login_VerifyLoginDetails", con)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserName", txtUsername.Text.Trim()); cmd.Parameters.AddWithValue("@Password", txtPassword.Text.Trim()); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { this.Hide(); Dashboard dsh = new Dashboard(); dsh.Show(); } else { MessageBox.Show("Username or Password is incorrect", "Login Failed!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } }
private void LoadAllSizesIntoGrid() { using (SqlConnection con = new SqlConnection(Application_Settings.ConnectionString())) { using (SqlCommand cmd = new SqlCommand("MSP_LoadDataIntoGrid", con)) { cmd.CommandType = CommandType.StoredProcedure; if (con.State != ConnectionState.Open) { con.Open(); } DataTable dt = new DataTable(); using (SqlDataReader dr = cmd.ExecuteReader()) { if (dr.HasRows) { dt.Load(dr); SizesdataGridView1.DataSource = dt; SizesdataGridView1.Columns[0].Visible = false; } } } } }
public IActionResult Update([FromBodyAttribute] Application_Settings _application_Settings) { if (!ModelState.IsValid) { return(Ok(new Application_ResponseWrapper() { ResponseCode = "1000", ResponseMessage = "Invalid model", Status = "failed" })); } Application_Settings application_Settings = _application_SettingsRepository.Update(_application_Settings); return(Ok(new Application_ResponseWrapper() { ResponseCode = "0", ResponseMessage = "information saved", Status = "success", ResponseResult = application_Settings })); }
public IActionResult FindById(long id) { Application_Settings application_Settings = _application_SettingsRepository.FindById(id); if (application_Settings == null) { return(Ok(new Application_ResponseWrapper() { ResponseCode = "1001", ResponseMessage = "Result not found", Status = "failed" })); } return(Ok(new Application_ResponseWrapper() { ResponseCode = "0", ResponseMessage = "success", Status = "success", ResponseResult = application_Settings })); }
private DataTable GetComboBoxData(int listTypeID) { DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(Application_Settings.ConnectionString())) { using (SqlCommand cmd = new SqlCommand("MSP_LoadDataIntoCombo", con)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ListTypeID", 1); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); dt.Load(dr); } } return(dt); }
public bool Insert(Application_Settings Settings) { try { if (Settings == null) { return(false); } var Obj = _db.ObjApplication_Settings.Add(Settings); _db.SaveChanges(); return(true); } catch (Exception e) { LogError(e, Settings.applicationID, 0); return(false); } }
public Application_Settings Update(Application_Settings Settings) { try { if (Settings == null) { return(null); } _db.ObjApplication_Settings.Update(Settings); _db.SaveChanges(); return(Settings); } catch (Exception e) { LogError(e, Settings.applicationID, 0); return(null); } }
public override void OnInspectorGUI() { // load asset file serializedObject.Update(); Application_SettingsAssets = (Application_Settings)target; #region Header // top Header originalGUIColor = GUI.color; EditorGUIUtility.labelWidth = 250; EditorGUILayout.Space(); EditorGUILayout.LabelField("Application Asset Settings Editor", EditorStyles.boldLabel); GUI.color = new Color(.75f, 1f, .75f); // Header's paragraph EditorGUILayout.LabelField("This editor will keep update necessary .asset files in your project. Don't change directory of the ''Resources/Application_Settings''.", EditorStyles.helpBox); GUI.color = originalGUIColor; EditorGUILayout.Space(); #endregion // move text to right EditorGUI.indentLevel++; // Open ScrollView ------------------------------------------------- scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false); // row space EditorGUILayout.Space(); #region General Settings - section //___________________________________________________________________________________________________ // fold GeneralSettings section foldGeneralSettings = EditorGUILayout.Foldout(foldGeneralSettings, "Application General Settings"); if (foldGeneralSettings) { // outer box EditorGUILayout.BeginVertical(GUI.skin.box); // must add EndVertical() GUI.color = new Color(.75f, 1f, .75f); GUILayout.Label("General Settings", EditorStyles.boldLabel); GUI.color = originalGUIColor; // Value- overrideFixedTimeStep EditorGUILayout.PropertyField(serializedObject.FindProperty("overrideFixedTimeStep"), new GUIContent("Override FixedTimeStep")); // Value- fixedTimeStep if (Application_SettingsAssets.overrideFixedTimeStep) { EditorGUILayout.PropertyField(serializedObject.FindProperty("fixedTimeStep"), new GUIContent("Fixed Timestep")); } // Value- maxAngularVelocity EditorGUILayout.PropertyField(serializedObject.FindProperty("maxAngularVelocity"), new GUIContent("Maximum Angular Velocity")); // Value- behaviorType EditorGUILayout.PropertyField(serializedObject.FindProperty("behaviorType"), new GUIContent("Behavior Type")); GUI.color = new Color(.75f, 1f, .75f); // Green box tooltip EditorGUILayout.HelpBox("Using behavior preset will override settings, yaw, roll, and other stuff. Using ''Custom'' mode will not override anything.", MessageType.Info); GUI.color = originalGUIColor; // Value- useFixedWheelColliders EditorGUILayout.PropertyField(serializedObject.FindProperty("useFixedWheelColliders"), new GUIContent("Use Fixed WheelColliders")); EditorGUILayout.EndVertical(); } #endregion EditorGUILayout.Space(); #region Controller Settings - section foldControllerSettings = EditorGUILayout.Foldout(foldControllerSettings, "Controller Settings"); if (foldControllerSettings) { // Controller Types List <string> controllerTypeStrings = new List <string>(); controllerTypeStrings.Add("HeadSet"); controllerTypeStrings.Add("Mobile"); controllerTypeStrings.Add("Custom"); // box Main Controller Type------------------------------------------------- EditorGUILayout.BeginVertical(GUI.skin.box); GUI.color = new Color(.75f, 1f, .75f); GUILayout.Label("Main Controller Type", EditorStyles.boldLabel); // 3 tabs GUI.color = new Color(.5f, 1f, 1f, 1f); Application_SettingsAssets.toolbarSelectedIndex = GUILayout.Toolbar(Application_SettingsAssets.toolbarSelectedIndex, controllerTypeStrings.ToArray()); GUI.color = originalGUIColor; #region Tabs if (Application_SettingsAssets.toolbarSelectedIndex == 0) { // box 1------------------------------------------------- EditorGUILayout.BeginVertical(GUI.skin.box); // set enum Application_SettingsAssets.controllerType = Application_Settings.ControllerType.Headset; GUILayout.Label("Settings", EditorStyles.boldLabel); // properties EditorGUILayout.PropertyField(serializedObject.FindProperty("Bool1"), new GUIContent("use Bool1")); EditorGUILayout.PropertyField(serializedObject.FindProperty("Bool2"), new GUIContent("run Bool2")); EditorGUILayout.PropertyField(serializedObject.FindProperty("Bool3"), new GUIContent("keep Bool3")); EditorGUILayout.PropertyField(serializedObject.FindProperty("Bool4"), new GUIContent("auto Bool4")); EditorGUILayout.PropertyField(serializedObject.FindProperty("Bool5"), new GUIContent("fix Bool5")); EditorGUILayout.PropertyField(serializedObject.FindProperty("UIButtonSensitivity"), new GUIContent("UI Button Sensitivity")); EditorGUILayout.PropertyField(serializedObject.FindProperty("UIButtonGravity"), new GUIContent("UI Button Gravity")); EditorGUILayout.PropertyField(serializedObject.FindProperty("gyroSensitivity"), new GUIContent("gyro Sensitivity")); EditorGUILayout.EndVertical(); // close box 1------------------------------------------- } if (Application_SettingsAssets.toolbarSelectedIndex == 1) { // box 2------------------------------------------------- EditorGUILayout.BeginVertical(GUI.skin.box); Application_SettingsAssets.controllerType = Application_Settings.ControllerType.Mobile; GUILayout.Label("Settings", EditorStyles.boldLabel); // properties EditorGUILayout.PropertyField(serializedObject.FindProperty("UIButtonSensitivity"), new GUIContent("UI Button Sensitivity")); EditorGUILayout.PropertyField(serializedObject.FindProperty("uiType"), new GUIContent("UI Type")); GUI.color = new Color(.75f, 1f, .75f); EditorGUILayout.EndVertical(); // close box 2------------------------------------------- } if (Application_SettingsAssets.toolbarSelectedIndex == 2) { // box 3------------------------------------------------- EditorGUILayout.BeginVertical(GUI.skin.box); Application_SettingsAssets.controllerType = Application_Settings.ControllerType.Custom; GUILayout.Label("Settings", EditorStyles.boldLabel); // properties GUI.color = new Color(.75f, 1f, .75f); EditorGUILayout.HelpBox("In this mode, controller won't receive these inputs from keyboard or UI buttons. You need to feed these inputs in your own script.", MessageType.Info); EditorGUILayout.Space(); EditorGUILayout.HelpBox("controller uses these inputs; \n \n A Input = Clamped 0f - 1f. \n B Input = Clamped 0f - 1f. \n C Input = Clamped -1f - 1f. ", MessageType.Info); EditorGUILayout.Space(); GUI.color = originalGUIColor; EditorGUILayout.EndVertical(); // close box 3------------------------------------------- } #endregion #region Main Controller Settings //box Main------------------------------------------------- EditorGUILayout.BeginVertical(GUI.skin.box); GUI.color = new Color(.75f, 1f, .75f); GUILayout.Label("Main Controller Settings", EditorStyles.boldLabel); GUI.color = originalGUIColor; EditorGUILayout.PropertyField(serializedObject.FindProperty("units"), new GUIContent("Units")); EditorGUILayout.EndVertical(); //close box Main------------------------------------------- #endregion EditorGUILayout.EndVertical(); } #endregion #region Resources EditorGUILayout.BeginVertical(GUI.skin.box); GUILayout.Label("Resources", EditorStyles.boldLabel); EditorGUILayout.PropertyField(serializedObject.FindProperty("A"), new GUIContent("1"), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("B"), new GUIContent("2"), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("C"), new GUIContent("3"), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("D"), new GUIContent("4"), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("E"), new GUIContent("5"), false); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); #endregion EditorGUILayout.EndScrollView(); // Close ScrollView ------------------------------------------------- #region footer EditorGUILayout.BeginVertical(GUI.skin.button); // -> must have !!!! EditorGUILayout.EndVertical(); GUI.color = new Color(.75f, 1f, .75f); GUI.color = new Color(.5f, 1f, 1f, 1f); // reset button if (GUILayout.Button("Reset To Defaults")) { //ResetToDefaults(); Debug.Log("Resetted To Defaults!"); } // url button if (GUILayout.Button("Browse Site")) { string url = "http://www.google.com"; Application.OpenURL(url); } GUI.color = originalGUIColor; EditorGUILayout.LabelField("GAME NAME", EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(50f)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Box(_logo); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUILayout.Space(); #endregion EditorGUILayout.EndVertical(); // update changes to asset file serializedObject.ApplyModifiedProperties(); if (GUI.changed) { EditorUtility.SetDirty(Application_SettingsAssets); } }