public void clickFinancialYear(QuarterEntity quarter) { if (financialYearPopWin.IsShowing) { financialYearPopWin.Dismiss(); } if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any()) { var selected = BaseApplication.GetInstance().quarterList.FirstOrDefault(i => i.IsCurrent); if (quarter.QuarterName == selected.QuarterName) { return; } foreach (var item in BaseApplication.GetInstance().quarterList) { if (quarter.QuarterName == item.QuarterName) { item.IsCurrent = true; } else { item.IsCurrent = false; } } financialYearPopWin.SetSelectedColor(); GetRenewData(); } }
private void write(MessageType t) { for (var i = 0; i < CNT; i++) { BaseApplication.WriteToLog(t, tbFrom.Text, tbText.Text + i.ToString()); } }
public ApplicationModule(BaseApplication <User> app) { For <BaseApplication <User> >().Use(app); For <IFileSystemLocations>().Use <AndroidFileLocations>(); For <ISQLitePlatform>().Use(new SQLitePlatformAndroid()); For <IConnectivityMonitor>().Use(new ConnectivityMonitor <User>(app)); }
public Navigation(Forms startingForm) { InitializeComponent(); SaveNextForm(startingForm); CenterToScreen(); Application = new BaseApplication(); }
private async Task AttemptUnlock(string password) { RunOnUiThread(delegate { _progressIndicator.Visibility = ViewStates.Visible; }); try { await BaseApplication.Unlock(password); } catch { RunOnUiThread(delegate { _progressIndicator.Visibility = ViewStates.Invisible; _passwordLayout.Error = GetString(Resource.String.passwordIncorrect); }); if (_failedAttempts > MaxAttempts) { Toast.MakeText(this, Resource.String.tooManyAttempts, ToastLength.Short).Show(); Finish(); return; } _failedAttempts++; return; } SetResult(Result.Ok); Finish(); }
public static void Main(string[] args) { BaseApplication.BaseMain(args, "Aurora.AvatarServer.ini", new MinimalSimulationBase("Aurora.AvatarServer ", new List <Type> { typeof(IAvatarData), typeof(IInventoryData), typeof(IUserAccountData), typeof(IAssetDataPlugin) }, new List <Type> { typeof(IAvatarService), typeof(IInventoryService), typeof(IUserAccountService), typeof(IAssetService), typeof(ISyncMessagePosterService), typeof(ISyncMessageRecievedService), typeof(IExternalCapsHandler), typeof(IConfigurationService), typeof(IGridServerInfoService), typeof(IAgentAppearanceService), typeof(IJ2KDecoder) })); }
public static void Main(string[] args) { BaseApplication.BaseMain(args, "WhiteCore.InventoryServer.ini", new MinimalSimulationBase("WhiteCore.InventoryServer ", new List <Type> { typeof(IInventoryData), typeof(IUserAccountData), typeof(IAssetDataPlugin), typeof(ISimpleCurrencyConnector), typeof(IAgentInfoConnector) }, new List <Type> { typeof(IInventoryService), typeof(ILibraryService), typeof(IUserAccountService), typeof(IAssetService), typeof(IMoneyModule), typeof(ISyncMessagePosterService), typeof(ISyncMessageRecievedService), typeof(IAgentInfoService), typeof(IExternalCapsHandler), typeof(IConfigurationService), typeof(IGridServerInfoService), typeof(IJ2KDecoder) })); }
public LoginForm() { InitializeComponent(); register = null; application = null; }
protected override void OnCreate(Bundle savedInstanceState) { BaseApplication.GetInstance().teacherList = null; LayoutReourceId = Resource.Layout.activity_teacher_list; base.OnCreate(savedInstanceState); }
private BaseApplication MapToApplication(InputModel inputModel) { var fac = Faculties.FirstOrDefault(x => x.FacultyId == inputModel.FacultyId); var lec = Lecterns.FirstOrDefault(x => x.LecternId == inputModel.LecternId); var application = new BaseApplication { Email = inputModel.Email, Password = inputModel.Password, UserType = inputModel.UserType, DocNo = inputModel.DocNo, FirstName = inputModel.FirstName, SecondName = inputModel.SecondName, Faculty = Faculties.FirstOrDefault(x => x.FacultyId == inputModel.FacultyId), Lectern = Lecterns.FirstOrDefault(x => x.LecternId == inputModel.LecternId), CreatedAt = DateTime.Now }; if (inputModel.UserType == UserType.Student) { application.UserType = UserType.Student; application.DegreeType = inputModel.DegreeType; application.Curriculum = Curriculums.FirstOrDefault(x => x.CurriculumId == inputModel.CurriculumId); application.YearNo = inputModel.YearNo; } else { application.UserType = UserType.Lecturer; application.DegreeType = DegreeType.Unknown; application.Curriculum = null; } return(application); }
public static void Main(string[] args) { BaseApplication.BaseMain(args, "Universe.GridServer.ini", new MinimalSimulationBase("Universe.GridServer ", new List <Type> { typeof(IRegionData), typeof(IAgentInfoConnector), typeof(IUserAccountData), typeof(IAssetDataPlugin) }, new List <Type> { typeof(IGridService), typeof(IAssetService), typeof(IAgentInfoService), typeof(IConfigurationService), typeof(ISyncMessagePosterService), typeof(ISyncMessageRecievedService), typeof(IExternalCapsHandler), typeof(IUserAccountService), typeof(IGridServerInfoService), typeof(IMapService), typeof(IJ2KDecoder) })); }
public ApplicationModule(BaseApplication<User> app) { For<BaseApplication<User>>().Use(app); For<IFileSystem>().Use(new AndroidFileSystem()); For<ISQLitePlatform>().Use(new SQLitePlatformAndroid()); For<IConnectivityMonitor>().Use<ConnectivityMonitor>(); For<IZipStreamProcessor>().Use<ZipStreamProcessorWrapper>(); }
public virtual T GetApplication <T>() where T : BaseApplication, new() { T ret = BaseApplication.GetInstante <T>(); ret.Context = _context; return(ret); }
static void Main(string[] args) { using (var app = new BaseApplication(args, null)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Shell()); } }
/// <summary> /// 删除教师信息 /// </summary> private void DoDelete() { try { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } LoadingDialogUtil.ShowLoadingDialog(this, "删除中..."); new Thread(new ThreadStart(() => { var schoolId = CurrUserInfo.SchoolId; var type = 2; //type = 1 助教相关身份 type = 2 教师相关身份 var keyword = et_teachercode.Text; var modifier = CurrUserInfo.Name; var rd = _meService.DeleteManagerUser(schoolId, type.ToString(), keyword, modifier); RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); if (rd.State == 0) { ToastUtil.ShowErrorToast(this, (string.IsNullOrEmpty(rd.Error) ? "操作失败" : rd.Error)); } else { if (BaseApplication.GetInstance().teacherList != null) { BaseApplication.GetInstance().teacherList.Remove(currTeacher); } ToastUtil.ShowSuccessToast(this, "操作成功"); new Handler().PostDelayed(() => { Finish(); OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out); }, 1000); } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); ToastUtil.ShowErrorToast(this, "操作失败"); } finally { LoadingDialogUtil.DismissLoadingDialog(); } }
protected override void LoadData() { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } //年级数据 if (BaseApplication.GetInstance().gradeList == null) { BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId); } if (BaseApplication.GetInstance().gradeList != null && BaseApplication.GetInstance().gradeList.Any()) { gradeList = new List <string>(BaseApplication.GetInstance().gradeList.Select(i => i.GradeName).ToArray()); } //默认年级全选 if (searchGradeList != null && searchGradeList.Any()) { var selectedgrade = "全部年级"; if (searchGradeList.Count > 0 && searchGradeList.Count != gradeList.Count) { selectedgrade = string.Join(",", searchGradeList.ToArray()); } tv_grade.Text = selectedgrade; } else { searchGradeList = new List <string>(gradeList.ToArray()); } //科目数据 if (BaseApplication.GetInstance().courseList == null) { BaseApplication.GetInstance().courseList = DistrictService.GetCourseList(CurrUserInfo.SchoolId); } if (BaseApplication.GetInstance().courseList != null && BaseApplication.GetInstance().courseList.Any()) { courseList = new List <string>(BaseApplication.GetInstance().courseList.Select(t => t.CourseName).ToArray()); } //默认科目 if (!string.IsNullOrEmpty(searchCourse)) { tv_course.Text = searchCourse; } else { searchCourse = BaseApplication.GetInstance().courseList[0].CourseName; tv_course.Text = searchCourse; } BindData(); }
#pragma warning restore 8618 protected void Init(Bundle savedInstanceState, params string[] flags) { global::Xamarin.Forms.Forms.SetFlags(flags); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); FormsMaterial.Init(this, savedInstanceState); Platform.Init(this, savedInstanceState); Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState); Acr.UserDialogs.UserDialogs.Init(this); Instance = this; }
private void button6_Click(object sender, EventArgs e) { for (int i = 0; i < 1000; i++) { BaseApplication.WriteToLog("Message number: " + i.ToString()); } BaseApplication.Instance.Log.Write(new NFX.Log.Message() { }); }
protected void LoadData() { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } //财年数据 if (BaseApplication.GetInstance().quarterList == null) { BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId); } //区域数据 if (BaseApplication.GetInstance().districtList == null) { BaseApplication.GetInstance().districtList = RenewService.GetDistrictList(CurrUserInfo.SchoolId); } //默认财年 if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any()) { quarterList = BaseApplication.GetInstance().quarterList; searchQuarter = BaseApplication.GetInstance().quarterList.Find(t => t.IsCurrent); tv_year.Text = searchQuarter.QuarterName; } //默认区域 if (BaseApplication.GetInstance().districtList != null && BaseApplication.GetInstance().districtList.Any()) { districtList = new List <string>(BaseApplication.GetInstance().districtList.Select(i => i.DistrictName).ToArray()); //加区域的权限判断--区域经理登录 if (CurrUserInfo.Type == (int)UserType.AreaManager) { districtList = districtList.Where(p => p == CurrUserInfo.DistrictName).ToList(); tv_district.Text = CurrUserInfo.DistrictName; searchDistrict = CurrUserInfo.DistrictName; } } //默认新生类型 if (categoryList != null && categoryList.Any()) { searchCagetory = categoryList[0]; tv_cagetory.Text = searchCagetory; } else { BindCategoryList(); } BindData(); }
public MainForm(IUiAction[] actions, PictureBox pictureBox, BaseApplication baseApplication) { this.baseApplication = baseApplication; var mainMenu = new MenuStrip(); mainMenu.Items.AddRange(actions.ToMenuItems()); Controls.Add(mainMenu); ClientSize = new Size(600, 400); this.pictureBox = pictureBox; pictureBox.SizeMode = PictureBoxSizeMode.AutoSize; FormBorderStyle = FormBorderStyle.FixedSingle; Closed += (a, b) => baseApplication.Close(); }
/// <summary> /// 获取财年季度数据 /// </summary> private void LoadQuarterData() { try { new Thread(new ThreadStart(() => { BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(currUserInfo.SchoolId); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); } }
public virtual ActionResult Create(Feedback model) { ViewBag.FeedbackSubjects = repository.All <FeedbackSubject>(); if (ModelState.IsValid) { try { model.PublishDate = DateTime.UtcNow; this.repository.Insert(model); this.repository.Save(); emailResult result; var admins = Roles.GetUsersInRole(BaseApplication.AdminRole).Select(x => { BaseProfile profile; if (BaseApplication.IsSimpleMembershipProviderConfigured()) { profile = BaseProfile.CreateProfile(this.repository, x); } else { profile = BaseProfile.CreateProfile(x); } return(profile != null ? profile.Email : string.Empty); }).Where(x => !string.IsNullOrEmpty(x)); var subject = this.repository.Find <FeedbackSubject>(model.FeedbackSubjectId).Subject; mailer.Send(string.Join(",", admins), "Feedback submitted", string.Format(@"<h3>A new comment with the category <em>{0}</em> has been posted</h3> <strong>Submitted by</strong>: {1}<br /><strong>Reply to</strong>: {2}<p>{3}</p>", subject, model.Name, model.Email, model.Comment), out result); } catch (Exception ex) { return(HttpStatusCode(System.Net.HttpStatusCode.InternalServerError, ex)); } return(Json(new { success = true, message = FormMessages.FeedbackPostSuccess, content = this.RenderPartialViewToString("list", this.repository.AllIncluding <Feedback>(x => x.FeedbackSubject).OrderByDescending(x => x.PublishDate)) })); } else { return(HttpStatusCode(System.Net.HttpStatusCode.BadRequest, new InvalidOperationException( string.Join("; ", ModelState.Values.SelectMany(x => x.Errors.Select(e => e.ErrorMessage)))))); } }
//... public Themes(BaseApplication application) : base() { Get.New <Themes>(this); DefaultResources.Add(new AssemblyResource(AssemblyData.Name)); application.Resources.MergedDictionaries.Add(this); application.Resources.MergedDictionaries.Add(New(AssemblyData.Name, $"Styles/Generic.xaml")); FolderPath = $@"{ApplicationProperties.GetFolderPath(DataFolders.Documents)}\Themes"; if (!Folder.Long.Exists(FolderPath)) { System.IO.Directory.CreateDirectory(FolderPath); } Custom.Refresh(FolderPath); }
/// <summary> /// 页面数据 /// </summary> protected void LoadData() { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } else { LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中..."); if (BaseApplication.GetInstance().quarterList == null || !BaseApplication.GetInstance().quarterList.Any()) { BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId); } if (BaseApplication.GetInstance().gradeList == null) { BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId); } GetRenewData(); // 财年选择 #region if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any()) { tv_year.Visibility = ViewStates.Visible; tv_year.Click += (sender, e) => { if (financialYearPopWin == null) { financialYearPopWin = new PopWin_IndexFinancialYear(CurrActivity, BaseApplication.GetInstance().quarterList); financialYearPopWin.clickItem += new PopWin_IndexFinancialYear.ClickItem(clickFinancialYear); } financialYearPopWin.OutsideTouchable = true; if (!financialYearPopWin.IsShowing) { financialYearPopWin.ShowAsDropDown(tv_year, 0, -15); } }; } #endregion } }
public static void Main(string[] args) { BaseApplication.BaseMain(args, "WhiteCore.AssetServer.ini", new MinimalSimulationBase("WhiteCore.AssetServer ", new List <Type> { typeof(IAssetDataPlugin) }, new List <Type> { typeof(IAssetService), typeof(ISyncMessagePosterService), typeof(ISyncMessageRecievedService), typeof(IExternalCapsHandler), typeof(IConfigurationService), typeof(IGridServerInfoService), typeof(IJ2KDecoder) })); }
protected override void OnResume() { base.OnResume(); if (BaseApplication.GetInstance().teacherList != null) { if (teacherList.Count < BaseApplication.GetInstance().teacherList.Count) { totalCount++; } else if (teacherList.Count > BaseApplication.GetInstance().teacherList.Count) { totalCount--; } tvTeacherCount.Text = string.Format("所有教师({0}人)", totalCount >= 0 ? totalCount : 0); teacherList = BaseApplication.GetInstance().teacherList; mAdapter.SetData(teacherList); mAdapter.NotifyDataSetChanged(); } }
/// <summary> /// Updates the profile data source with changed profile property values. /// </summary> /// <remarks>If the SimpleMembershipProvider is configured for use, then the /// profile properties will be saved to the associated UserProfile table.</remarks> public override void Save() { if (BaseApplication.IsSimpleMembershipProviderConfigured() && this.repository != null) { var up = this.repository.FindBy <UserProfile>(x => x.UserName == this.UserName).SingleOrDefault(); if (up != null) { up.FirstName = this.FirstName; up.LastName = this.LastName; up.Email = this.Email; this.repository.Update <UserProfile>(up); this.repository.Save(); } } else { base.Save(); } }
/// <summary> /// 页面数据 /// </summary> protected void LoadData() { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中..."); if (BaseApplication.GetInstance().quarterList == null) { BaseApplication.GetInstance().quarterList = RenewService.GetQuarter(CurrUserInfo.SchoolId); } if (BaseApplication.GetInstance().gradeList == null) { BaseApplication.GetInstance().gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId); } if (BaseApplication.GetInstance().districtList == null) { BaseApplication.GetInstance().districtList = RenewService.GetDistrictList(CurrUserInfo.SchoolId); } if (BaseApplication.GetInstance().quarterList != null && BaseApplication.GetInstance().quarterList.Any()) { quarterList = BaseApplication.GetInstance().quarterList; searchQuarter = BaseApplication.GetInstance().quarterList.Find(t => t.IsCurrent); tv_btn1.Text = searchQuarter.QuarterName; } if (BaseApplication.GetInstance().gradeList != null && BaseApplication.GetInstance().gradeList.Any()) { gradeList = new List <string>(BaseApplication.GetInstance().gradeList.Select(i => i.GradeName).ToArray()); // 默认全选 searchGradeList = new List <string>(gradeList.ToArray()); } if (BaseApplication.GetInstance().districtList != null && BaseApplication.GetInstance().districtList.Any()) { districtList = new List <string>(BaseApplication.GetInstance().districtList.Select(i => i.DistrictName).ToArray()); } GetRenewInfoInGroup(); }
/// <summary> /// создать заявку /// </summary> /// <param name="request">модель создания заявки</param> public async Task CreateApp(CreateApplicationRequest request) { try { var now = DateTime.UtcNow; var app = new BaseApplication { Title = request.Title, Description = request.Description, Status = Status.Open, DateModify = now, HistoryIds = new List <long>().SerializeToJson() }; db.BaseApplications.Add(app); db.SaveChanges(); var histories = db.BaseHistories; var history = new BaseHistory { AppId = app.Id, DateModify = now, StatusOld = null, StatusNew = app.Status, Comment = null }; db.BaseHistories.Add(history); db.SaveChanges(); var appHistory = new JsonSerializer().Deserialize <List <long> > (new JsonTextReader (new StringReader(app.HistoryIds))); appHistory.Add(history.Id); app.HistoryIds = appHistory.SerializeToJson(); db.SaveChanges(); } catch { } }
public WindowWrapper(BaseApplication app) { mApp = app; Win = new Form(); Win.Height = 600; Win.Width = 800; mMainMenu = new MenuStrip() { Dock = DockStyle.Top }; Win.Controls.Add(mMainMenu); mMainPanel = new Panel() { Top = mMainMenu.Height, Left = 0, Width = Win.ClientSize.Width, Height = Win.ClientSize.Height - mMainMenu.Height, Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom }; Win.Controls.Add(mMainPanel); }
protected override void InitVariables() { Bundle bundle = Intent.Extras; if (bundle != null) { scopeName = bundle.GetString("scopeName"); pageFromType = bundle.GetInt("pageFromType", 1); var teacherJsonStr = bundle.GetString("teacherJsonStr"); if (!string.IsNullOrEmpty(teacherJsonStr)) { currTeacher = JsonSerializer.ToObject <TeacherListModel>(teacherJsonStr); if (pageFromType == 1 && BaseApplication.GetInstance().teacherList != null) { currTeacher = BaseApplication.GetInstance().teacherList.FirstOrDefault(i => i.Code == currTeacher.Code); } tScopeCode = currTeacher.ScopeCode ?? 0; tType = currTeacher.Type ?? 0; } } }
public CoreModule(BaseApplication<User> app) { this.app = app; }
public ConnectivityMonitor(BaseApplication<User> app) { this.app = app; }