//async void loadListsFromDB_(string dashName, string selectUser, A0DbMdl db) { await loadListsFromDB(dashName, selectUser, db); } void loadListsFromDB(string dashName, string selectUser, A0DbMdl db) { if (string.IsNullOrEmpty(selectUser) || string.IsNullOrEmpty(dashName) /*|| SelectUser.Equals(selectUser)*/) { return; } if (!SelectUser.Equals(selectUser)) { SelectUser = selectUser; } TypeCatch.Net5.Properties.Settings.Default.LastUser = SelectUser; TypeCatch.Net5.Properties.Settings.Default.Save(); try { var dbsrlst = db.SessionResults.Where(r => r.UserId == SelectUser && r.ExcerciseName == dashName && r.Duration > TimeSpan.Zero).OrderByDescending(r => r.DoneAt).ToList(); RcrdCpm = dbsrlst?.Count() > 0 ? (int)(dbsrlst?.Max(r => r.PokedIn / r.Duration.TotalMinutes) ?? 110) : 99; MaxCpm = 0 + 2 * RcrdCpm; Debug.WriteLine($"~~~ C: {db.SessionResults.Count()} - {CurUserCurExcrsRsltLst.Count}"); CurUserCurExcrsRsltLst.ClearAddRangeAuto(dbsrlst); Debug.WriteLine($"~~~ D: {db.SessionResults.Count()} - {CurUserCurExcrsRsltLst.Count}"); } catch (Exception ex) { ex.Log(); synth.SpeakAsyncCancelAll(); synth.SpeakFaF($"Something is not right: {ex.Message}. Talk to you later"); } }
public entity GetUser(int id) { entity Baxter = new entity(); var entityboom = new EntityA(); entityboom = new SelectUser().GetUser(id); Baxter.id = entityboom.id; Baxter.Daleman = new List <isilist>(); Baxter.Daleman.Add(new isilist() { FirstName = entityboom.FirstName }); Baxter.Daleman.Add(new isilist() { LastName = entityboom.LastName }); Baxter.Daleman.Add(new isilist() { EmailID = entityboom.EmailID }); Baxter.Daleman.Add(new isilist() { City = entityboom.City }); Baxter.Daleman.Add(new isilist() { Country = entityboom.Country }); return(Baxter); }
/// <summary> /// Delay before save data. /// </summary> /// <returns></returns> IEnumerator SaveDelay( ) { yield return(new WaitForSeconds(DELAY_TIME)); SyncToDataValue(_using.profile.score); SelectUser selectUser = new SelectUser(); // Set data to PlayerPrefs. ( ArrayPrefs ) selectUser.SetIntArr(DataMatching <int> (dataValue.score, selectUser.GetIntList( ))); selectUser.SetVec3Arr(DataMatching <Vector3> (dataValue.position, selectUser.GetVec3List( ))); selectUser.SetColorArr(DataMatching <Color> (dataValue.engine, selectUser.GetColorList(SelectUser.PlayerPrefsKeys.ENGINE_COLOR)), SelectUser.PlayerPrefsKeys.ENGINE_COLOR); selectUser.SetColorArr(DataMatching <Color> (dataValue.binder, selectUser.GetColorList(SelectUser.PlayerPrefsKeys.BINDER_COLOR)), SelectUser.PlayerPrefsKeys.BINDER_COLOR); selectUser.SetColorArr(DataMatching <Color> (dataValue.body, selectUser.GetColorList(SelectUser.PlayerPrefsKeys.BODY_COLOR)), SelectUser.PlayerPrefsKeys.BODY_COLOR); // Make passcode by current data. string pass = _using.mathHelp.MakePass(_using.profile.colorBody, _using.profile.colorBinder, _using.profile.colorEngine, new Vector3(_using.profile.xPos, _using.profile.yPos, _using.profile.zPos), _using.profile.score); _using.profile.passCode = pass; Debug.Log("PassCode : " + pass); // Print debug to option _using.game.DebugConsole("Save!! : To PlayerPrefs"); _using.game.DebugConsole("Position : " + new Vector3(_using.profile.xPos, _using.profile.yPos, _using.profile.zPos)); _using.game.DebugConsole("Score : " + _using.profile.score); _using.game.DebugConsole("PassCode : " + _using.profile.passCode); }
// Use this for initialization void Start() { su = GameObject.FindObjectOfType <SelectUser> ( ); // Add unity event on click in button. listView.onClick.AddListener(() => su.SetCurrentUser(listView_text.text)); del.onClick.AddListener(() => su.Delete(listView_text.text)); }
public ContentResult GetTeachers() { var lecturers = SelectUser.SelectAllTeachers(); return(new ContentResult { Content = JsonSerializer.Serialize(lecturers), ContentType = "application/json", StatusCode = (int)HttpStatusCode.OK }); }
/// <summary> /// Sync data from ArrayPrefs into player data. /// Or Sync data from passcode into player data. /// Load data on start scene "GamePlay" /// </summary> public override void Load( ) { SelectUser selectUser = new SelectUser( ); dataValue.username = FindIndex <string> (selectUser.GetStringList( )); dataValue.score = FindIndex <int> (selectUser.GetIntList( )); dataValue.position = FindIndex <Vector3> (selectUser.GetVec3List( )); dataValue.engine = FindIndex <Color> (selectUser.GetColorList(SelectUser.PlayerPrefsKeys.ENGINE_COLOR)); dataValue.binder = FindIndex <Color> (selectUser.GetColorList(SelectUser.PlayerPrefsKeys.BINDER_COLOR)); dataValue.body = FindIndex <Color> (selectUser.GetColorList(SelectUser.PlayerPrefsKeys.BODY_COLOR)); if (PlayerPrefs.HasKey("Passcode")) { string s = PlayerPrefs.GetString("Passcode"); PlayerPrefs.DeleteKey("Passcode"); if (_using.mathHelp.FromPass(s)) { dataValue.score = _using.mathHelp.score; dataValue.position = _using.mathHelp.rotate; dataValue.engine = _using.mathHelp.engine; dataValue.binder = _using.mathHelp.binder; dataValue.body = _using.mathHelp.body; } else { Debug.LogWarning("Passcode is worng!! "); SceneManager.LoadScene("Menu"); } } try { // Set score. _using.profile.score = dataValue.score; _using.game.SetScore(_using.profile.score); // Set position. _using.profile.xPos = dataValue.position.x; _using.profile.yPos = dataValue.position.y; _using.profile.zPos = dataValue.position.z; _using.player.MoveToRotation(dataValue.position); // Set ship color. _using.profile.LoadColor(dataValue.engine, dataValue.binder, dataValue.body); // Print debug to option _using.game.DebugConsole("Load!!"); _using.game.DebugConsole("Position : " + new Vector3(_using.profile.xPos, _using.profile.yPos, _using.profile.zPos)); _using.game.DebugConsole("Score : " + _using.profile.score); } catch { } }
private void LoadNhanVien() { try { SelectUser sl = new SelectUser(); us = sl.List_SelectUser(); gc.DataSource = us; } catch (Exception ex) { lg.Error(ex); } }
// Manage users view public IActionResult ManageUsers(int id = -1) { if (!_auth.Authorise(RolesEnum.Admin, _context)) // Check logged in as admin { return(Redirect("~/Project/Dashboard")); } var vm = new ManageUsersViewModel(); // new view model vm.AllUsers = new List <TableProjectUser>(); // instanciate all users // Foreach user in the database foreach (var user in _context.Users) { // Create a temp user var temp = new TableProjectUser(); temp.Email = user.Email ?? "This user has not given an email."; temp.Username = user.UserName; temp.Role = _context.Roles.First(r => r.RoleId == user.RoleId).RoleName; temp.MinutesBooked = user.UserId; // Add temp user to view model vm.AllUsers.Add(temp); } // If there's an id given and it's a valid id if (id != -1 && _context.Users.Any(u => u.UserId == id)) { // Create new temp selected user and fill out fields var temp = new SelectUser(); temp.User = _context.Users.First(u => u.UserId == id); temp.Role = _context.Roles.First(r => r.RoleId == temp.User.RoleId).RoleName; var projectIds = _context.ProjectUsers.Where(p => p.UserId == temp.User.UserId).Select(c => c.ProjectId).ToList(); temp.MemberOfProjects = _context.Projects.Where(p => projectIds.Contains(p.ProjectId)) .Select(p => p.ProjectName).ToList(); // All user to view model vm.SelectedUser = temp; } // Get project names from the database vm.ProjectNames = _context.Projects.Select(p => p.ProjectName).ToList(); // Get roles from the database vm.AllRoles = _context.Roles.Select(r => r.RoleName).ToList(); // Return the view return(View(vm)); }
public ActionResult AllBill() { var bill = db.Bills.ToList(); var user = db.Users.ToList(); SelectUser su = new SelectUser() { Users = user, Bill = bill, }; return(View(su)); }
public void DashboardShare() { ComplianceHeatMap(); WaitforIt(Properties.LittlePause); DashboardGear.Clicks(); AdminSettings.Clicks(); WaitforIt(Properties.LittlePause); CopyfromAdmin("Shared", "share").Clicks(); WaitforIt(Properties.LittlePause); DahsboardSelect("Shared").Clicks(); SelectUser.SelectDropdown("Automation User 2"); AddUser.Clicks(); SaveShare.Clicks(); LogOut.Clicks(); PlanLog.Login("automationuser2", "eMos123!"); WaitforIt(Properties.LittlePause); DashboardTab.Clicks(); }
private void button3_Click(object sender, EventArgs e) { try { SqlConnection MyConnection = new SqlConnection(Form1.Conn_String); MyConnection.Open(); string cmd = "select Users.U_ID,Users.F_NAME,Users.EMAIL,Users.PASSWORD," + "Users.NIC,users.ADDRESS," + "Student.STD_ID, Student.ROLL_NO," + "Student.BATCH, Student.SECTION, Student.DISCIPLINE" + " from Users inner join Student on users.U_ID = Student.U_ID Order by U_ID ASC"; SqlCommand mycmd = new SqlCommand(cmd, MyConnection); SqlDataAdapter DAdap = new SqlDataAdapter(mycmd); DataTable DT = new DataTable(); DAdap.Fill(DT); dataGridView1.DataSource = DT; MyConnection.Close(); DAdap.Dispose(); } catch (Exception SelectUser) { MessageBox.Show(SelectUser.ToString()); } }
/// <summary> /// 라이브러리 시작 /// </summary> /// <param name="UseSecurityMode">wcf메시지 보안을 사용 할건지 말건지 </param> /// <param name="ServiceURL">접속 하고자 하는 주소</param> /// <param name="EncryptSeed">보안 시드키</param> /// <param name="id">로그인 id</param> /// <param name="password">로그인 패스워드</param> private Hitpan5ClientLibrary(bool UseSecurityMode, string ServiceURL, string EncryptSeed, string id, string password) { if (UseSecurityMode) { proxyController = new WebServiceProxyController(id, password, ServiceURL); } else { proxyController = new WebServiceProxyController(ServiceURL); } SQLDataServiceModel = new SQLDataServiceModel(EncryptSeed, ServiceURL, this.proxyController.proxy); //로그인 하기 (만약 아무것도 없으면 초기관리자 로서 모든 설정권한을 가짐: 빈 데이터 일 테니까 상관없다) 초기관리자는 계속 관리자 권한 갖는다 SelectUser su = new SelectUser(null); su.work = "처음 사용자인지 검증"; IList <UserInfoProxyVO> UserList = (IList <UserInfoProxyVO>)su.GetData(); if (UserList == null || UserList.Count == 0) { this.userInfo = new UserInfoProxyVO(); this.userInfo["UserID"] = "Admin"; this.userInfo["UserType"] = 사용자등급.관리자; this.userInfo["견적관리"] = 사용자권한.모두허용; this.userInfo["계정관리"] = 사용자권한.모두허용; this.userInfo["고객정보"] = 사용자권한.모두허용; this.userInfo["나의정보관리"] = 사용자권한.모두허용; this.userInfo["데이터관리"] = 사용자권한.모두허용; this.userInfo["매입관리"] = 사용자권한.모두허용; this.userInfo["상품정보"] = 사용자권한.모두허용; this.userInfo["세금계산서관리"] = 사용자권한.모두허용; this.userInfo["양식정보"] = 사용자권한.모두허용; this.userInfo["에프터서비스관리"] = 사용자권한.모두허용; this.userInfo["인사관리"] = 사용자권한.모두허용; this.userInfo["일정관리"] = 사용자권한.모두허용; this.userInfo["재고관리"] = 사용자권한.모두허용; this.userInfo["판매관리"] = 사용자권한.모두허용; this.userInfo["표준관리"] = 사용자권한.모두허용; this.userInfo["회계관리"] = 사용자권한.모두허용; } else { object obj = new LogIn(id, password).GetData(); try { this.userInfo = (UserInfoProxyVO)obj; } catch (InvalidCastException) { throw new System.Exception("아이디가 존재하지 않거나 패스워드가 틀렸습니다"); } catch (System.Exception ex) { throw new System.Exception(string.Format("로그인을 실패하였습니다 ({0})", ex.Message)); } } //설정정보 가져오기 try { object obj = new SelectCommonSettings().GetData(); this.settingInfo = (CommonSettingProxyVO)obj; } catch (System.Exception) { } //자기 자신의 정보 가져오기 try { object obj = new SelectMyCompany().GetData(); this.myInfo = (MyCompanyProxyVO)obj; } catch (System.Exception) { } if (this.myInfo == null) { this.myInfo = new MyCompanyProxyVO(); } if (this.settingInfo == null) { this.settingInfo = new CommonSettingProxyVO(); } }
void ControlTreeDataLoader.LoadData() { basicBody.Attributes.Add("onpagehide", "hideProcessingDialog();"); form.Action = EwfPage.Instance.InfoAsBaseType.GetUrl(); var warningControls = new List <Control>(); if (!AppTools.IsLiveInstallation) { var children = new List <Control>(); children.Add("This is not the live system. Changes made here will be lost and are not recoverable. ".GetLiteralControl()); if (AppTools.IsIntermediateInstallation && AppRequestState.Instance.IntermediateUserExists) { children.Add( new PostBackButton( PostBack.CreateFull( id: "ewfIntermediateLogOut", firstModificationMethod: IntermediateAuthenticationMethods.ClearCookie, actionGetter: () => new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl))), new ButtonActionControlStyle("Log Out", ButtonActionControlStyle.ButtonSize.ShrinkWrap), false)); } warningControls.Add(new PlaceHolder().AddControlsReturnThis(children.ToArray())); } else if (ConfigurationStatics.MachineIsStandbyServer) { warningControls.Add( "This is a standby system. It operates with a read-only database, and any attempt to make a modification will result in an error.".GetLiteralControl()); } if (AppRequestState.Instance.UserAccessible && AppRequestState.Instance.ImpersonatorExists && (!AppTools.IsIntermediateInstallation || AppRequestState.Instance.IntermediateUserExists)) { warningControls.Add( new PlaceHolder().AddControlsReturnThis( "User impersonation is in effect. ".GetLiteralControl(), EwfLink.Create( SelectUser.GetInfo(EwfPage.Instance.InfoAsBaseType.GetUrl()), new ButtonActionControlStyle("Change User", ButtonActionControlStyle.ButtonSize.ShrinkWrap)), " ".GetLiteralControl(), new PostBackButton( PostBack.CreateFull( id: "ewfEndImpersonation", firstModificationMethod: UserImpersonationStatics.EndImpersonation, actionGetter: () => new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl))), new ButtonActionControlStyle("End Impersonation", ButtonActionControlStyle.ButtonSize.ShrinkWrap), usesSubmitBehavior: false))); } if (warningControls.Any()) { var warningControl = warningControls.Count() > 1 ? ControlStack.CreateWithControls(true, warningControls.ToArray()) : warningControls.Single(); ph.AddControlsReturnThis(new Block(warningControl) { CssClass = CssElementCreator.TopWarningBlockCssClass }); } ph2.AddControlsReturnThis(new Block { CssClass = CssElementCreator.ClickBlockingBlockCssClass }, getProcessingDialog()); ph2.AddControlsReturnThis(new NamingPlaceholder(getStatusMessageDialog())); var ajaxLoadingImage = new EwfImage("Images/ajax-loader.gif") { CssClass = "ajaxloaderImage" }; ajaxLoadingImage.Style.Add("display", "none"); ph2.AddControlsReturnThis(ajaxLoadingImage); EwfPage.Instance.ClientScript.RegisterOnSubmitStatement(GetType(), "formSubmitEventHandler", "postBackRequestStarted()"); }
void ControlTreeDataLoader.LoadData() { basicBody.Attributes.Add("onpagehide", "deactivateProcessingDialog();"); form.Action = EwfPage.Instance.InfoAsBaseType.GetUrl(); ph.AddControlsReturnThis( new NamingPlaceholder( EwfPage.Instance.StatusMessages.Any() && statusMessagesDisplayAsNotification() ? new Block { CssClass = notificationSpacerClass }.ToCollection() : Enumerable.Empty <Control>())); var warningLines = new List <IReadOnlyCollection <PhrasingComponent> >(); if (!ConfigurationStatics.IsLiveInstallation) { var components = new List <PhrasingComponent>(); components.Add(new FontAwesomeIcon("fa-exclamation-triangle", "fa-lg")); components.AddRange(" This is not the live system. Changes made here will be lost and are not recoverable. ".ToComponents()); if (ConfigurationStatics.IsIntermediateInstallation && AppRequestState.Instance.IntermediateUserExists) { components.AddRange( new EwfButton( new StandardButtonStyle("Log out", buttonSize: ButtonSize.ShrinkWrap), behavior: new PostBackBehavior( postBack: PostBack.CreateFull( id: "ewfIntermediateLogOut", firstModificationMethod: NonLiveInstallationStatics.ClearIntermediateAuthenticationCookie, actionGetter: () => new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl))))).Concat(" ".ToComponents())); } components.Add( new EwfButton( new StandardButtonStyle( "Hide this warning", buttonSize: ButtonSize.ShrinkWrap, icon: new ActionComponentIcon(new FontAwesomeIcon("fa-eye-slash"))), behavior: new PostBackBehavior( postBack: PostBack.CreateIntermediate( null, id: "ewfHideNonLiveWarnings", firstModificationMethod: NonLiveInstallationStatics.SetWarningsHiddenCookie)))); if (ConfigurationStatics.IsIntermediateInstallation && AppRequestState.Instance.IntermediateUserExists) { var boxId = new ModalBoxId(); components.AddRange( " ".ToComponents() .Append( new EwfButton( new StandardButtonStyle("Get link", buttonSize: ButtonSize.ShrinkWrap, icon: new ActionComponentIcon(new FontAwesomeIcon("fa-link"))), behavior: new OpenModalBehavior( boxId, etherealChildren: new ModalBox( boxId, true, FormItemList.CreateGrid( 1, items: new[] { false, true }.Select( i => { var url = AppRequestState.Instance.Url; if (AppRequestState.Instance.UserAccessible && AppRequestState.Instance.ImpersonatorExists) { url = SelectUser.GetInfo( url, optionalParameterPackage: new SelectUser.OptionalParameterPackage { User = AppTools.User.Email }) .GetUrl(); } url = IntermediateLogIn.GetInfo( url, new IntermediateLogIn.OptionalParameterPackage { Password = ConfigurationStatics.SystemGeneralProvider.IntermediateLogInPassword, HideWarnings = i }) .GetUrl(); return(new GenericPhrasingContainer( url.ToComponents(), classes: new ElementClass("ewfIntermediateUrl" /* This is used by EWF CSS files. */)).ToFormItem( label: i ? "Non-live warnings hidden:".ToComponents() : "Standard:".ToComponents())); }) .Materialize()) .ToCollection()).ToCollection())))); } warningLines.Add(components); } if (AppRequestState.Instance.UserAccessible && AppRequestState.Instance.ImpersonatorExists && (!ConfigurationStatics.IsIntermediateInstallation || AppRequestState.Instance.IntermediateUserExists)) { warningLines.Add( "User impersonation is in effect. ".ToComponents() .Append( new EwfHyperlink( SelectUser.GetInfo(AppRequestState.Instance.Url), new ButtonHyperlinkStyle("Change user", buttonSize: ButtonSize.ShrinkWrap))) .Concat(" ".ToComponents()) .Append( new EwfButton( new StandardButtonStyle("End impersonation", buttonSize: ButtonSize.ShrinkWrap), behavior: new PostBackBehavior( postBack: PostBack.CreateFull( id: "ewfEndImpersonation", firstModificationMethod: UserImpersonationStatics.EndImpersonation, actionGetter: () => new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl)))))) .Materialize()); } if (warningLines.Any()) { ph.AddControlsReturnThis( new GenericFlowContainer( warningLines.Aggregate((components, line) => components.Append(new LineBreak()).Concat(line).Materialize()), displaySetup: new DisplaySetup(ConfigurationStatics.IsLiveInstallation || !NonLiveInstallationStatics.WarningsHiddenCookieExists()), classes: topWarningContainerClass).ToCollection() .GetControls()); } // This is used by the EWF JavaScript file. const string clickBlockerId = "ewfClickBlocker"; ph2.AddControlsReturnThis( new Block { ClientIDMode = ClientIDMode.Static, ID = clickBlockerId, CssClass = clickBlockerInactiveClass }, new PlaceHolder().AddControlsReturnThis(getProcessingDialog().GetControls()), new NamingPlaceholder(getStatusMessageControl())); }
void ControlTreeDataLoader.LoadData() { basicBody.Attributes.Add("onpagehide", "deactivateProcessingDialog();"); form.Action = EwfPage.Instance.InfoAsBaseType.GetUrl(); ph.AddControlsReturnThis( new NamingPlaceholder( EwfPage.Instance.StatusMessages.Any() && statusMessagesDisplayAsNotification() ? new Block { CssClass = notificationSpacerClass }.ToSingleElementArray() : new Control[0])); var warningControls = new List <Control>(); if (!ConfigurationStatics.IsLiveInstallation) { var children = new List <Control>(); children.Add(new FontAwesomeIcon("fa-exclamation-triangle", "fa-lg")); children.Add(" This is not the live system. Changes made here will be lost and are not recoverable. ".GetLiteralControl()); if (ConfigurationStatics.IsIntermediateInstallation && AppRequestState.Instance.IntermediateUserExists) { children.Add( new PostBackButton( PostBack.CreateFull( id: "ewfIntermediateLogOut", firstModificationMethod: IntermediateAuthenticationMethods.ClearCookie, actionGetter: () => new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl))), new ButtonActionControlStyle("Log Out", ButtonActionControlStyle.ButtonSize.ShrinkWrap), false)); } warningControls.Add(new PlaceHolder().AddControlsReturnThis(children.ToArray())); } else if (ConfigurationStatics.MachineIsStandbyServer) { warningControls.Add( new PlaceHolder().AddControlsReturnThis( new FontAwesomeIcon("fa-exclamation-triangle", "fa-lg"), " This is a standby system. It operates with a read-only database, and any attempt to make a modification will result in an error.".GetLiteralControl())); } if (AppRequestState.Instance.UserAccessible && AppRequestState.Instance.ImpersonatorExists && (!ConfigurationStatics.IsIntermediateInstallation || AppRequestState.Instance.IntermediateUserExists)) { warningControls.Add( new PlaceHolder().AddControlsReturnThis( "User impersonation is in effect. ".GetLiteralControl(), EwfLink.Create( SelectUser.GetInfo(AppRequestState.Instance.Url), new ButtonActionControlStyle("Change User", ButtonActionControlStyle.ButtonSize.ShrinkWrap)), " ".GetLiteralControl(), new PostBackButton( PostBack.CreateFull( id: "ewfEndImpersonation", firstModificationMethod: UserImpersonationStatics.EndImpersonation, actionGetter: () => new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl))), new ButtonActionControlStyle("End Impersonation", ButtonActionControlStyle.ButtonSize.ShrinkWrap), usesSubmitBehavior: false))); } if (warningControls.Any()) { var warningControl = warningControls.Count() > 1 ? ControlStack.CreateWithControls(true, warningControls.ToArray()) : warningControls.Single(); ph.AddControlsReturnThis(new Block(warningControl) { CssClass = topWarningBlockCssClass }); } // This is used by the EWF JavaScript file. const string clickBlockerId = "ewfClickBlocker"; ph2.AddControlsReturnThis( new Block { ClientIDMode = ClientIDMode.Static, ID = clickBlockerId, CssClass = clickBlockerInactiveClass }, getProcessingDialog(), new NamingPlaceholder(getStatusMessageControl())); EwfPage.Instance.ClientScript.RegisterOnSubmitStatement(GetType(), "formSubmitEventHandler", "postBackRequestStarted()"); }
static void Main(string[] args) { Console.WriteLine("Main Menu \r\n \r\n User Operations: \r\n 0. See Registered Users \r\n 1. Register User \r\n 2. Update User \r\n "); Console.WriteLine("Physical Address Operations: \r\n 3. Enter User Physical Address \r\n 4. Update User Physical Address \r\n "); Console.WriteLine("Postal Address Operations: \r\n 5. Enter User Postal Address \r\n 6. Update User Postal Address \r\n "); Console.WriteLine("User Approval Operations: \r\n 7. Press 1 to Approve User"); Console.WriteLine("User Deletion Operations: \r\n 8. Press 1 to Delete User"); //Object in use by 2---Methods as Parameter ,thats why is Glabol var user = new _User(); var physical = new Physical_Address(); var postal = new Postal_Address(); int option = Convert.ToInt32(Console.ReadLine()); switch (option) { case 0: var objSelectUser = new SelectUser(); objSelectUser.RetrieveUser(); break; case 1: var objInsertUser = new InsertUser(); objInsertUser.EnterUserDetails(user); Console.WriteLine("would you like to add your physical address: Y/N"); string value = Console.ReadLine(); string lower = value.ToLower(); if (lower == "y") { var objaddressOption = new InsertPhysical(); objaddressOption.EnterPhysicalAddressDetails(physical); } else if (lower == "n") { Console.WriteLine("Thank you"); } break; case 2: var objUpdateUser = new UpdateUser(); objUpdateUser.EnterUpdateUserDetails(user); break; case 3: var objInsertPhysical = new InsertPhysical(); objInsertPhysical.EnterPhysicalAddressDetails(physical); break; case 4: var objUpdatePhysical = new UpdatePhysical(); objUpdatePhysical.EnterPhysicalUpdateDetails(physical); break; case 5: var objInsertPostal = new InsertPostal(); objInsertPostal.EnterPostalAddressDetails(postal); break; case 6: var objUpdatePostal = new UpdatePostal(); objUpdatePostal.EnterPostalUpdateDetails(postal); break; case 7: var objUpdateApprovalStatus = new UpdateApprovalStatus(); objUpdateApprovalStatus.EnterUpdateStatus(); break; case 8: var objSoftDeleteUser = new DeleteUser(); objSoftDeleteUser.UserIdToDelete(); break; default: Console.WriteLine("Opps! Invalid option entered. Retry"); Console.ReadKey(); break; } }