private FbXpertMainForm() { InitializeComponent(); NotificationsForm.Instance().Init(); NotifiesClass.Instance().Notify.OnRaiseInfoHandler += InfoRaised; NotifiesClass.Instance().Notify.OnRaiseErrorHandler += ErrorRaised; LanguageClass.Instance().OnRaiseLanguageChangedHandler += FBXpertMainForm_OnRaiseLanguageChangedHandler; NotificationsForm.Instance().SetMDIForm(this); string appfile = Application.StartupPath + "\\config\\AppSettings.json"; if (File.Exists(appfile)) { AppSettingsClass appset = fastJSON.JSON.ToObject(File.ReadAllText(appfile)) as AppSettingsClass; AppSettingsClass.Instance().Load(appset); } else { AppSettingsClass.Instance(); } NotifiesClass.Instance().InfoThreshold = eInfoLevel.normal; //(eInfoLevel) AppSettingsClass.Instance().BehavierSettings.DebugThreshold; }
public void checkInternetUserDeActive() { var _User = _context.InternetUsers.Where(x => x.IsDelete == false && x.IsActive == true).ToList(); foreach (var i in _User) { DateTime todaydate = DateTime.Now.Date; if (i.User_EndDate == todaydate) { var noitictioneform = new NotificationsForm { contents = "اتتهاء صلاحية اشتراكك يرجى التفعيل", headings = "يرجى الانتباه", url = "http://sys.center-wifi.com", //included_segments = "All", include_external_user_ids = i.Id.ToString(), }; _ = SendNoitications(noitictioneform); var InternetUsers = _context.InternetUsers.Where(x => x.Id == i.Id).FirstOrDefault(); InternetUsers.IsActive = false; _context.Entry(InternetUsers).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _context.SaveChanges(); } } }
public ActionResult <IEnumerable <string> > Sendnotifications(Guid InternetUserId, string notifications) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } // var InternetUsers = _context.InternetUsers.Where(x => x.Id == InternetUserId).FirstOrDefault(); var noitictioneform = new NotificationsForm { contents = notifications, headings = "يرجى الانتباه", url = "https://sys.center-wifi.com", ///included_segments = "All", include_external_user_ids = InternetUserId.ToString() }; _ = SendNoiticationsforusers(noitictioneform); return(Ok(new Response { Message = "Done !", Data = noitictioneform, Error = false })); }
private FbXpertMainForm(string appSettingsFile) { InitializeComponent(); NotificationsForm.Instance().Init(); NotifiesClass.Instance.Register4Info(InfoRaised); NotifiesClass.Instance.Register4Error(ErrorRaised); LanguageClass.Instance.RegisterChangeNotifiy(FBXpertMainForm_OnRaiseLanguageChangedHandler); NotificationsForm.Instance().SetMDIForm(this); string appfile = appSettingsFile; if (File.Exists(appfile)) { AppSettingsClass appset = fastJSON.JSON.ToObject(File.ReadAllText(appfile)) as AppSettingsClass; appset.Path = appfile; AppSettingsClass.Instance.Load(appset); } else { AppSettingsClass.Instance.Path = appfile; } NotifiesClass.Instance.InfoGranularity = eMessageGranularity.normal; //(eMessageGranularity) AppSettingsClass.Instance.BehavierSettings.DebugThreshold; }
private string SendNoitications(NotificationsForm form) { var client = new RestClient(_configuration["onesginelUsers:Url"]); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Authorization", _configuration["onesginelUsers:Authorization"]); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Cookie", "__cfduid=d8a2aa2f8395ad68b8fd27b63127834571600976869"); var body = new { app_id = _configuration["onesginelUsers:app_id"], contents = new { en = form.contents }, headings = new { en = form.headings }, url = form.url, //included_segments = new string[] { form.included_segments }, include_external_user_ids = new string[] { form.include_external_user_ids }, }; request.AddJsonBody(body); IRestResponse response = client.Execute(request); return(response.Content); }
public ActionResult Add(NotificationsForm frm) { if (!ModelState.IsValid) { return(Content("Error")); } if (frm.SeasonId != null) { switch (frm.RelevantEntityLogicalName) { case LogicaName.Team: notesRep.SendToTeam(frm.SeasonId.Value, frm.EntityId, frm.Message); break; case LogicaName.League: notesRep.SendToLeague(frm.SeasonId.Value, frm.EntityId, frm.Message); break; case LogicaName.Union: notesRep.SendToUnion(frm.SeasonId.Value, frm.EntityId, frm.Message); break; case LogicaName.Club: //notesRep.SendToClub(frm.SeasonId.Value, frm.EntityId, frm.Message); break; } } var notsServ = new GamesNotificationsService(); notsServ.SendPushToDevices(GlobVars.IsTest); return(RedirectToAction("List", new { entityId = frm.EntityId, logicalName = frm.RelevantEntityLogicalName })); }
private void FBXpertMainForm_Load(object sender, EventArgs e) { // LanguageClass.Instance().InitEmbedded(this,"FBXpert.Languages","Language","de"); LanguageClass.Instance().InitFile(this, $@"{Application.StartupPath}\Languages\", "Language", ".", "de"); LanguageClass.Instance().OnRaiseLanguageExceptionHandler += FbXpertMainForm_OnRaiseLanguageExceptionHandler; LanguageClass.Instance().ChangeLanguage(LanguageClass.German); Text = $@"FBXpert V {Assembly.GetAssembly(GetType()).GetName().Version}"; Application.DoEvents(); var cf = FBXInfo.Instance(); cf.MdiParent = this; cf.Show(); _dbe = DbExplorerForm.Instance(this); if (_dbe.ReadDatabaseDefinition()) { Application.DoEvents(); NotifiesClass.Instance().InfoThreshold = eInfoLevel.normal; _dbe.SetCaption(); _dbe.Show(); _dbe.Enabled = false; _dbe.MakeDatabaseTree(false); _dbe.OpenActiveDatabases(); if (NotificationsForm.Instance().Visible) { NotificationsForm.Instance().Close(); } NotifiesClass.Instance().InfoThreshold = eInfoLevel.few; } DbExplorerForm.Instance().Enabled = true; LanguageClass.Instance().ChangeLanguage(LanguageClass.German); }
public ActionResult <IEnumerable <string> > Complain([FromBody] AddComplaint form) { string currentUserId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; var _clientid = Guid.Parse(currentUserId); var internetuser = _context.InternetUsers.Where(x => x.Id == _clientid).FirstOrDefault(); var conplain = new User_Complaint { InternetUser_Id = _clientid, Complain = form.Complain, Complain_Date = DateTime.Now, Complain_Status = 0 }; _context.User_Complaint.Add(conplain); _context.SaveChanges(); var noitictioneform = new NotificationsForm { contents = "تم اضافة شكوى او رسالة من احد المشتركين", headings = "يرجى الانتباه", url = "http://tatwer.tech", included_segments = "Support", }; _ = SendNoitications(noitictioneform); return(Ok(new Response { Message = "Done !", Data = conplain, Error = false })); }
private void AcceptButton_Click(object sender, EventArgs e) { // Открытие формы уведомления о подтверждённой заявке. var notification = new NotificationsForm(); notification.NotificationLabel.Text = "Заявка подтверждена"; notification.StartPosition = FormStartPosition.CenterParent; notification.ShowDialog(this); }
/// <summary> /// Открыть форму уведомления о созданной заявке. /// </summary> private DialogResult Notify() { // Открытие формы уведомления о созданной заявке. NotificationsForm notification = new NotificationsForm(); notification.NotificationLabel.Text = "Заявка отправлена"; notification.Owner = this; notification.StartPosition = FormStartPosition.CenterParent; return(notification.ShowDialog()); }
public void checkInternetUserbefor3days() { var User = _context.InternetUsers.Where(x => x.IsDelete == false && x.IsActive == true).ToList(); foreach (var i in User) { DateTime futurDate = Convert.ToDateTime(i.User_EndDate.Date); DateTime TodayDate = DateTime.Now; var numberOfDays = (futurDate - TodayDate).TotalDays; if (numberOfDays == 3) { var noitictioneform = new NotificationsForm { contents = "سينتهي الاشتراك بعد ثلاثة ايام", headings = "يرجى الانتباه", url = "https://center-wifi.com", //included_segments = "All", include_external_user_ids = i.Id.ToString(), }; _ = SendNoitications(noitictioneform); } if (numberOfDays == 2) { var noitictioneform = new NotificationsForm { contents = "سينتهي الاشتراك بعد يومين", headings = "يرجى الانتباه", url = "https://center-wifi.com", //included_segments = "All", include_external_user_ids = i.Id.ToString(), }; _ = SendNoitications(noitictioneform); } if (numberOfDays == 2) { var noitictioneform = new NotificationsForm { contents = "اليوم سيتم انتهاء حسابك", headings = "يرجى الانتباه", url = "https://center-wifi.com", //included_segments = "All", include_external_user_ids = i.Id.ToString(), }; _ = SendNoitications(noitictioneform); } } }
private void SendToCustomerButton_Click(object sender, EventArgs e) { // TODO: Сделать проверку заполнения всех полей. if (true) // Если заполнены все поля. { // Открытие формы уведомления о подтверждённой заявке. var notification = new NotificationsForm(); notification.NotificationLabel.Text = "Заявка подтверждена"; notification.Owner = this; notification.StartPosition = FormStartPosition.CenterParent; notification.ShowDialog(); } }
void IEmployeeAddTasks.InsertTask(Tasks Taskform) { _context.Add(Taskform); var parts = _context.Teams.Where(x => x.Id == Taskform.Task_part).FirstOrDefault(); var noitictioneform = new NotificationsForm { contents = "تم اضافة تاسك جديد", headings = "يرجى الانتباه", url = "http://sys.center-wifi.com", included_segments = parts.Team_Roles, }; _ = SendNoitications(noitictioneform); }
public ActionResult Add(int entityId, LogicaName logicalName, int?unionId, int?clubId) { int currentUnionIdFromSession = GetCurrentUnionFromSession(); int?currentSeasonIdFromSession = GetUnionCurrentSeasonFromSession(); int?currentSeasonId = seasonsRepo.GetLasSeasonByUnionId(currentUnionIdFromSession); var vm = new NotificationsForm { SeasonId = currentSeasonIdFromSession, RelevantEntityLogicalName = logicalName, EntityId = entityId, NeedHideTextField = currentSeasonIdFromSession != currentSeasonId }; return(PartialView("_AddNew", vm)); }
public ActionResult <IEnumerable <string> > ActiveInternetUser([FromBody] ActiveInternetUser form, Guid InternetUserId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var InternetUsers = _context.InternetUsers.Where(x => x.Id == InternetUserId).FirstOrDefault(); InternetUsers.IsActive = true; InternetUsers.User_ActiveDate = form.User_ActiveDate; InternetUsers.User_EndDate = form.User_EndDate; InternetUsers.User_Card = form.User_Card; InternetUsers.User_Price = form.User_Price; _context.Entry(InternetUsers).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _context.SaveChanges(); var noitictioneform = new NotificationsForm { contents = "تم اعادة تفعيل اشتراكك - شركة واي فاي لخدمات الانترنت", headings = "يرجى الانتباه", url = "https://center-wifi.com", ///included_segments = "All", include_external_user_ids = InternetUserId.ToString() }; _ = SendNoiticationsforuser(noitictioneform); return(Ok(new Response { Message = "Done !", Data = InternetUsers, Error = false })); }
private void cmsNotifications_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem == tsmiNotes) { NotificationsForm.Instance().SetMDIForm(this); int wdh = DbExplorerForm.Instance().Width + 16; NotificationsForm.Instance().SetLeft = wdh; NotificationsForm.Instance().Set(); NotificationsForm.Instance().Show(); } else if (e.ClickedItem == tsmiErrors) { NotificationsForm.Instance().SetMDIForm(this); NotificationsForm.Instance().SetLeft = DbExplorerForm.Instance().Width + 16; NotificationsForm.Instance().Set(); NotificationsForm.Instance().Show(); } }
private async Task <bool> SendNoitications(NotificationsForm form) { var client = new RestClient(_configuration["onesginel:Url"]); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Authorization", _configuration["onesginel:Authorization"]); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Cookie", "__cfduid=d8a2aa2f8395ad68b8fd27b63127834571600976869"); //request.AddParameter("application/json", "{\r\n\"app_id\" : \"b7d2542a-824a-4afa-9389-08880920baa8\",\r\n\"contents\" : {\"en\" : \"تم اضافة تاسك جديد\"},\r\n\"headings\" : {\"en\" : \"يرجى الانتباة\"},\r\n\"url\" : \"http://wifihr.tatwer.tech\",\r\n\"included_segments\" : [\"All\"]\r\n}", ParameterType.RequestBody); try { var body = new { app_id = _configuration["onesginel:app_id"], contents = new { en = form.contents }, headings = new { en = form.headings }, url = form.url, included_segments = new string[] { form.included_segments } }; request.AddJsonBody(body); IRestResponse response = client.Execute(request); return(true); } catch (Exception e) { var data = e.Message; return(false); } }
private void FBXpertMainForm_Load(object sender, EventArgs e) { // LanguageClass.Instance.InitEmbedded(this,"FBXpert.Languages","Language","de"); ProgramAttributes.Instance.Init(System.Reflection.Assembly.GetExecutingAssembly()); LanguageClass.Instance.InitFile(this.GetType().Assembly, $@"{ApplicationPathClass.Instance.ApplicationPath}\Languages\", "Language", ".", "de"); LanguageClass.Instance.OnRaiseLanguageExceptionHandler += FbXpertMainForm_OnRaiseLanguageExceptionHandler; LanguageClass.Instance.ChangeLanguage(LanguageConsts.Deutsch); string test = LanguageClass.Instance.GetString("test"); this.Text = $@"{ProgramAttributes.Instance.GetAppName()} V {ProgramAttributes.Instance.GetAppVersion()}"; Application.DoEvents(); FBXInfo.Instance.MdiParent = this; FBXInfo.Instance.Show(); _dbe = DbExplorerForm.Instance(this); string pf = $@"{AppSettingsClass.Instance.PathSettings.DatabasesConfigPath}\{AppSettingsClass.Instance.PathSettings.DatabaseConfigFile}"; bool dz = DatabaseDefinitions.Instance.Deserialize(pf); SetLastLoadedDefinition(pf); if (dz) { Application.DoEvents(); NotifiesClass.Instance.InfoGranularity = eMessageGranularity.normal; _dbe.SetCaption(); _dbe.Show(); _dbe.Enabled = false; _dbe.MakeDatabaseTree(false); int n = DatabaseDefinitions.Instance.CountToOpen(); if (n > AppSettingsClass.Instance.DatabaseSettings.OpenDatabaseCount) { object[] p = { n, Environment.NewLine }; if (SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "OpenDatabases", "DoYouWantOpenDatabases", FormStartPosition.CenterScreen, SEMessageBoxButtons.NoYes, SEMessageBoxIcon.Exclamation, null, p) == SEDialogResult.Yes) { _dbe.OpenActiveDatabases(); } else { DatabaseDefinitions.Instance.DataState = EditStateClass.eDataState.UnSaved; DatabaseDefinitions.Instance.MarkDatabasesActiv(false); } } else { _dbe.OpenActiveDatabases(); } if (NotificationsForm.Instance().Visible) { NotificationsForm.Instance().Close(); } NotifiesClass.Instance.InfoGranularity = eMessageGranularity.few; } DbExplorerForm.Instance().Enabled = true; LanguageClass.Instance.ChangeLanguage(LanguageConsts.Deutsch); SEHotSpot.Controller.Instance.NewKeyboardHooks(this); DbExplorerForm.Instance().Select(); }
private void hsExportStructure_Click(object sender, EventArgs e) { var ew = new ExportWorkers(NotifiesClass.Instance()) { allviews = new List <ViewClass>() }; ew.allviews.Clear(); ew.alltables = new List <TableClass>(); ew.alltables.Clear(); ew.allPKConstraints = new Dictionary <string, PrimaryKeyClass>(); ew.allPKConstraints.Clear(); ew.allFKConstraints = new Dictionary <string, ForeignKeyClass>(); ew.allFKConstraints.Clear(); ew.allDomains = new Dictionary <string, DomainClass>(); ew.allDomains.Clear(); ew.allGenerator = new Dictionary <string, GeneratorClass>(); ew.allGenerator.Clear(); ew.allTrigger = new Dictionary <string, TriggerClass>(); ew.allTrigger.Clear(); ew.allIndeces = new Dictionary <string, IndexClass>(); ew.allIndeces.Clear(); ew.allProcedures = new Dictionary <string, ProcedureClass>(); ew.allProcedures.Clear(); ew.allFunctions = new Dictionary <string, FunctionClass>(); ew.allFunctions.Clear(); ew.AktDBReg = DBReg; ew.ShowScripting = cbViewObjectScript.Checked; ew.WriteToFile = cbObjectExportToFile.Checked; ew.CommitAfterStatement = cbStructureCommit.Checked; ew.CreateConnectionStatement = cbStructureConnectiionStatement.Checked; ew.CreateDatabaseStatement = cbStructureCreateDatabaseStatement.Checked; ew.CreateMode = (rbCREATEObject.Checked) ? eCreateMode.create : eCreateMode.recreate; if (ew.WriteToFile) { if ((txtFileName.Text.IndexOf(".")) < 0) { txtFileName.Text += ".sql"; } var di = ActFolder.Tag as DirectoryInfo; ew.SQLFileInfo = new FileInfo(di.FullName + "\\" + txtFileName.Text); ew.CharSet = cbCharSet.SelectedItem as EncodingClass; } else { ew.SQLFileInfo = null; } ew.StartworkerGetDatabaseStructure(DBReg, ew.SQLFileInfo); foreach (var itm in selExportStructureList.CheckedItemDatasNotNulls) { //if ((itm.Check != CheckState.Checked)||(itm.Object == null)) continue; if (itm.Object.GetType() == typeof(TableClass)) { ew.alltables.AddRange(ExportTableStructure(ew)); ew.StartworkerGetTableStructure(ew.alltables, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(ViewClass)) { ew.allviews.AddRange(ExportViewStructure(ew)); ew.StartworkerGetViewStructure(ew.allviews, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(PrimaryKeyClass)) { ExportPKTableStructure(ew); ew.StartworkerGetPKTableStructure(ew.allPKConstraints, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(ForeignKeyClass)) { ExportFKTableStructure(ew); ew.StartworkerGetFKTableStructure(ew.allFKConstraints, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(DomainClass)) { ExportDomainStructure(ew); ew.StartworkerGetDomainStructure(ew.allDomains, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(GeneratorClass)) { ExportGeneratorStructure(ew); ew.StartworkerGetGeneratorStructure(ew.allGenerator, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(IndexClass)) { ExportIndecesStructure(ew); ew.StartworkerGetIndecesStructure(ew.allIndeces, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(TriggerClass)) { ExportTriggerStructure(ew); ew.StartworkerGetTriggerStructure(ew.allTrigger, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(ProcedureClass)) { ExportProcedureStructure(ew); ew.StartworkerGetProcedureDefinitionStructure(ew.allProcedures, DBReg, ew.SQLFileInfo); ew.StartworkerGetProcedureStructure(ew.allProcedures, DBReg, ew.SQLFileInfo); } else if (itm.Object.GetType() == typeof(FunctionClass)) { ExportFunctionStructure(ew); ew.StartworkerGetFunctionDefinitionStructure(ew.allFunctions, DBReg, ew.SQLFileInfo); ew.StartworkerGetFunctionStructure(ew.allFunctions, DBReg, ew.SQLFileInfo); } } ew.WaitForWorker(); ew.MakeScript(); NotificationsForm.Instance().Close(); }