void AddTeam(Team tpl, Dashboard cats) { TreeIter iter = store.AppendValues (tpl.TeamName, null); foreach (Player p in tpl.List) { store.AppendValues (iter, p.Name, p); } }
protected void OnSelectedDashboardChanged() { Dashboard d = new Dashboard(); d.LoadFromXml(SelectedDashboard); var message = new DashboardMessage(d, DashboardMessageType.View); Messenger.Default.Send<DashboardMessage>(message); }
protected void Page_Load(object sender, EventArgs e) { user = (UserDetails)Session["LoggedUser"]; if (user == null) Response.Redirect("Login.aspx"); if (Request.QueryString["id"] == null) Response.Redirect("DashboardHome.aspx"); dashboardID = int.Parse(Request.QueryString["id"]); Dashboard currentDashboard = new Dashboard(); List<Dashboard> dashboardlist = new List<Dashboard>(); UserLoginClient client=new UserLoginClient(); if (Request.UrlReferrer.AbsolutePath.Equals("/CreateNewDashboard.aspx")) { user.UserDashboards = client.GetUserDashboards(user.UserId); } dashboardlist = user.UserDashboards.ToList(); currentDashboard = dashboardlist.Find(dash => dash.DashboardId == dashboardID); dashboardName.Text = currentDashboard.DashboardName; startMonth.Text =currentDashboard.StartMonth.ToString(); endMonth.Text = currentDashboard.EndMonth.ToString(); startYear.Text = currentDashboard.StartYear.ToString(); endYear.Text = currentDashboard.EndYear.ToString(); Description.Text = currentDashboard.Description; AccessRight = currentDashboard.UserAccessRight.AccessRightName; }
public void Page_Load(object sender, EventArgs e) { Dashboard[] UserDashboards; UserDetails user = new UserDetails(); user = (UserDetails)Session["LoggedUser"]; if (user == null) Response.Redirect("Login.aspx"); lblDashboardHeader.Text = user.FirstName + " " + user.LastName; UserLoginClient client = new UserLoginClient(); UserId = user.UserId; user.UserDashboards = client.GetUserDashboards(user.UserId); UserDashboards = new Dashboard[user.UserDashboards.Count()]; UserDashboards = user.UserDashboards; if (UserDashboards.Length == 0) { System.Web.UI.HtmlControls.HtmlGenericControl newDashboard = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV"); newDashboard.InnerHtml = "<div>You Have NO Dashboards... Create your Dashboards </div>"; this.DashContainer.Controls.Add(newDashboard); return; } string colorOFdiv = ""; string imageUrl = ""; for (int i = 0; i < UserDashboards.Length; i++) { if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("READ")) { colorOFdiv = "#4a8bc2"; imageUrl = "'Images/Read.png'"; } if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("WRITE")) { colorOFdiv = "#91929E"; imageUrl = "'Images/Write.png'"; } if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("ADMIN")) { colorOFdiv = "#f37b53"; imageUrl = "'Images/Admin.gif'"; } System.Web.UI.HtmlControls.HtmlGenericControl newDashboard = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV"); newDashboard.InnerHtml = "<a><div id=\"" + UserDashboards.ElementAt(i).DashboardId + "\" class=\"dashboard\" data-accessRight=\"" + UserDashboards.ElementAt(i).UserAccessRight.AccessRightName + "\" style=\"background-color:" + colorOFdiv + "\"><p class=left>" + UserDashboards.ElementAt(i).DashboardName + "</p><div class=right><img src=" + imageUrl + " class='rotateImage'/></div></div></a>"; this.DashContainer.Controls.Add(newDashboard); } if (user.IsOwner == true) { System.Web.UI.HtmlControls.HtmlGenericControl linkAdminControl = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV"); linkAdminControl.InnerHtml = "<a href=\"Teams.aspx?companyID=" + user.CompanyId + "\"><div class='button right font16'> Admin Operations </div></a>"; this.DashContainer.Controls.Add(linkAdminControl); } }
/// <summary> /// Migrate the specified dashboard to the current version format. /// </summary> /// <param name="dashboard">Dashboard.</param> public static void Migrate (Dashboard dashboard) { /* Apply all the migration steps starting from the current version*/ switch (dashboard.Version) { case 0: Migrate0 (dashboard); break; default: return; } Migrate (dashboard); }
protected void Page_Load(object sender, EventArgs e) { UserDetails user = (UserDetails)Session["LoggedUser"]; if (user == null) Response.Redirect("Login.aspx"); CompanyId = user.CompanyId; int dashboardID = int.Parse(Request.QueryString["id"]); Dashboard currentDashboard = new Dashboard(); List<Dashboard> dashboardlist = new List<Dashboard>(); dashboardlist = user.UserDashboards.ToList(); currentDashboard = dashboardlist.Find(dash => dash.DashboardId == dashboardID); AccessRight = currentDashboard.UserAccessRight.AccessRightName; }
private static DashboardNodePropertyBase CheckDashboardProperty(MyProject project, Dashboard dashboard, int nodeId, string taskName, string propertyName) { var node = project.Network.GetChildNodeById(nodeId) as MyWorkingNode; Assert.NotNull(node); MyTask task = node.GetTaskByPropertyName(taskName); Assert.NotNull(task); DashboardNodePropertyBase property = dashboard.Get(task, propertyName); Assert.NotNull(property); return property; }
#pragma warning disable 0618 public static void Migrate0 (Dashboard dashboard, IDictionary<string, Guid> dashboardNameToID = null, IDictionary<string, Guid> scoreNameToID = null, IDictionary<string, Guid> penaltyNameToID = null) { Guid id; if (dashboard.Version != 0) { return; } if (dashboardNameToID == null) { dashboardNameToID = new Dictionary<string, Guid> (); } if (scoreNameToID == null) { scoreNameToID = new Dictionary<string, Guid> (); } if (penaltyNameToID == null) { penaltyNameToID = new Dictionary<string, Guid> (); } if (dashboard.ID == Guid.Empty) { if (!dashboardNameToID.TryGetValue (dashboard.Name, out id)) { dashboardNameToID [dashboard.Name] = id = Guid.NewGuid (); } dashboard.ID = id; } foreach (ScoreButton button in dashboard.List.OfType<ScoreButton> ()) { Score score = button.OldScore; if (!scoreNameToID.TryGetValue (score.Name, out id)) { scoreNameToID [score.Name] = id = Guid.NewGuid (); } button.EventType = button.EventType.Clone (); button.EventType.ID = id; button.ScoreEventType.Score = score; } foreach (PenaltyCardButton button in dashboard.List.OfType<PenaltyCardButton> ()) { PenaltyCard penalty = button.OldPenaltyCard; if (!penaltyNameToID.TryGetValue (penalty.Name, out id)) { penaltyNameToID [penalty.Name] = id = Guid.NewGuid (); } button.EventType = button.EventType.Clone (); button.EventType.ID = id; button.PenaltyCardEventType.PenaltyCard = penalty; } dashboard.Version = 1; }
protected void Page_Load(object sender, EventArgs e) { dashboardID = int.Parse(Request.QueryString["id"]); user = (UserDetails)Session["LoggedUser"]; if (user == null) Response.Redirect("Login.aspx"); Dashboard currentDashboard = new Dashboard(); List<Dashboard> dashboardlist = new List<Dashboard>(); dashboardlist = user.UserDashboards.ToList(); currentDashboard = dashboardlist.Find(dash => dash.DashboardId == dashboardID); dashboardName.Text = currentDashboard.DashboardName; txtStartDate.Text = currentDashboard.StartMonth + " / " + currentDashboard.StartYear; txtEndDate.Text = currentDashboard.EndMonth + " / " + currentDashboard.EndYear; txtDescription.Text = currentDashboard.Description; }
public ActionResult Index(Dashboard datos) { DataClasses1DataContext db = new DataClasses1DataContext(); //consulta para seleccionar y filtrar los datos iniciales List<Dashboard> lista = db.habitacions.Select(a => new Dashboard() { numero = a.numero, reservas = a.reservas.Select(b => new res() { idHa = b.idHab, fechainicial = b.fecha_ini, fechafinal = b.fecha_fin, totaldias = b.fecha_fin.Subtract(b.fecha_ini).Days }).ToList() }).ToList(); ViewBag.info = lista; DateTime hoy = DateTime.Parse(datos.fechaInicio.Day + "-" + datos.fechaInicio.Month + "-" + datos.fechaInicio.Year); int anio = hoy.Year; int mes = hoy.Month; int dia = hoy.Day; string value = ""; while (value != "Monday") { DateTime find = new DateTime(anio, mes, dia); dia--; if (dia < 1) { mes--; if (mes < 1) { anio--; mes = 12; } dia = DateTime.DaysInMonth(anio, mes); } value = find.DayOfWeek.ToString(); } dia++; DateTime hh = hoy; List<DateTime> semanas = new List<DateTime>(); for (int i = 0; i < 7; i++) { semanas.Add(hh.AddDays(i)); } ViewBag.fechas = semanas; return View(); }
private void bckButton_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Do you really want to go back?", "Confirmation", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { Dashboard d = new Dashboard(); d.Show(); this.Close(); } else { Staff i = new Staff(); i.Show(); this.Close(); } }
private void BindDashboardToUI(Dashboard dashboard) { if (dashboard == null) throw new ArgumentNullException("dashboard"); litTitle.Text = dashboard.Title; litContent.Text = dashboard.Content; string attachedFile = dashboard.AttachedFileName; litAttachedFile.Visible = false; if (!string.IsNullOrEmpty(attachedFile)) { litAttachedFile.Visible = true; AttachedFile.Text = attachedFile; AttachedFile.NavigateUrl = string.Format("/Upload/Attachments/{0}", attachedFile); } }
protected void Page_Load(object sender, EventArgs e) { Dashboard[] UserDashboards; UserDetails user = new UserDetails(); user = (UserDetails)Session["LoggedUser"]; if (user == null) Response.Redirect("Login.aspx"); UserLoginClient client = new UserLoginClient(); user.UserDashboards = client.GetUserDashboards(user.UserId); UserDashboards = new Dashboard[user.UserDashboards.Count()]; UserDashboards = user.UserDashboards; for (int i = 0; i < UserDashboards.Length; i++) { string dashboardName = UserDashboards.ElementAt(i).DashboardName; string dashboardID = UserDashboards.ElementAt(i).DashboardId.ToString(); dashboard.Items.Add(new ListItem(dashboardName, dashboardID)); } }
public bool Add(string Title, string Content, string ReceiverPhoneNumber,string SenderPhoneNumber, string filePath) { try { Dashboard o = new Dashboard(); o.Title = Title; o.Content = Content; o.CreateDate = DateTime.Now; o.UpdateDate = DateTime.Now; o.IsDeleted = false; o.IsRead = false; o.ReceiverPhoneNumber = ReceiverPhoneNumber; o.SenderPhoneNumber = SenderPhoneNumber; o.AttachedFileName = filePath; db.Dashboards.InsertOnSubmit(o); db.SubmitChanges(); return true; } catch { return false; } }
public void Page_Load(object sender, EventArgs e) { UserDetails user = new UserDetails(); user = (UserDetails)Session["LoggedUser"]; if (user == null) Response.Redirect("Login.aspx"); if (Request.QueryString["id"] == null) Response.Redirect("DashboardHome.aspx"); dashboardID = int.Parse(Request.QueryString["id"]); List<Dashboard> dashboardlist = new List<Dashboard>(); dashboardlist = user.UserDashboards.ToList(); count = dashboardlist.Count; Dashboard currentDashboard = new Dashboard(); currentDashboard = dashboardlist.Find(dash => dash.DashboardId == dashboardID); LblDashboardName.Text = currentDashboard.DashboardName; CalendarWeekRule weekRule = CalendarWeekRule.FirstFourDayWeek; DayOfWeek firstWeekDay = DayOfWeek.Monday; Calendar calendar = System.Threading.Thread.CurrentThread.CurrentCulture.Calendar; currentWeek = calendar.GetWeekOfYear(DateTime.Now, weekRule, firstWeekDay); UserID = user.UserId; AccessRight = currentDashboard.UserAccessRight.AccessRightName; CompanyId = user.CompanyId; }
/// <summary> /// Initializes a new instance of the <see cref="DashboardEncryptor" /> class. /// </summary> /// <param name="dashboard">The dashboard.</param> public DashboardEncryptor(Dashboard dashboard) { this.seed = Convert.FromBase64String(dashboard.Key); this.salt = Convert.FromBase64String(dashboard.Salt); this.key = EncryptionHelper.GenerateAesKeyFromSeed(seed, salt); }
public DashboardInfo(List<WorkerInfo> workers, Dashboard info) { this.workers = workers; this.info = info; }
/// <summary> /// Creates a new instance of the dashboard node. /// </summary> /// <param name="dashboard"> /// The owning dashboard. /// </param> /// <param name="xmlNode"> /// The xml node that contains the /// dashboard node definition. /// </param> public DashboardNodeMeasureLabel(Dashboard dashboard, XmlNode xmlNode) : base(dashboard, xmlNode) { }
public DashboardEditor(Dashboard _dashboard) { InitializeComponent(); dashboard = _dashboard; }
public void SetAsMain(Dashboard dashboard) { }
public void InsertGraph(Dashboard entity) { _context.Dashboards.Add(entity); }
public void WhenIClickOnLoadMoreButton() { Dashboard.ClickLoadMore(); }
/// <summary> /// Creates a new instance of <see cref="ImportRecentTweetsFromTwitterApiTask"/>, as well as a dashboard instance, which allows to import recent tweets from a certain dashboard. /// </summary> /// <param name="serviceProvider">An instance of <see cref="IServiceProvider"/>, used for dependency injection.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <param name="dashboard">An instance of a dashboard, so only recent tweets for that dashboard are updated.</param> public ImportRecentTweetsFromTwitterApiTask([NotNull] IServiceProvider serviceProvider, [NotNull] CancellationToken cancellationToken, [NotNull] Dashboard dashboard) : this(serviceProvider, cancellationToken) { _dashboard = dashboard; }
public void WhenIClickOnLoadMoreButtonOnNotifications() { //waits and then clicks on the load more button Dashboard.ClickLoadMore(); }
public void ThenShowLessShouldBeVisible() { //waits and verifies if the show less button is visible Dashboard.ShowLessIsVisible(); }
public void GivenIClickOnTheDashboard() { //waits for the dashboad button to be visible and clicks on the dashboard button Dashboard.ClickOnDashboard(); }
// Return List of Escalated Cases public ActionResult GetEscalatedList() { long userId; if (Session["USER"] != null) { userId = ((User)Session["USER"]).UserID; } else { userId = 1; } unitOfWork = (GenericUnitOfWork)Session["UNITOFWORK"]; GenericRepository <User> userRepository = unitOfWork.GetRepoInstance <User>(); GenericRepository <Case> caseRepository = unitOfWork.GetRepoInstance <Case>(); var result = caseRepository.GetBy(c => c.StartupID == userId).OrderBy(c => c.CategoryID); List <Case> EscalatedList = new List <Case>(); if (result.Count() != 0) { foreach (Case c in result) { if (c.StatusID == 3) { EscalatedList.Add(c); } } } /////////////////////////////////////////////////////////////////// GenericRepository <Priority> priority_caseRepository = unitOfWork.GetRepoInstance <Priority>(); //GenericRepository<Status> status_caseRepository = unitOfWork.GetRepoInstance<Status>(); GenericRepository <Category> category_caseRepository = unitOfWork.GetRepoInstance <Category>(); List <Priority> priorities = priority_caseRepository.GetAll().ToList(); List <Category> categories = category_caseRepository.GetAll().ToList(); ViewBag.Priorities = priorities; ViewBag.Categories = categories; Dashboard model = new Dashboard() { Escalated = EscalatedList }; NewCaseVM newcasevm = new NewCaseVM(); newcasevm.Case = new Case(); newcasevm.CaseID = newcasevm.Case.CaseID; model.newCaseVM = newcasevm; GenericRepository <User> userRepo = unitOfWork.GetRepoInstance <User>(); GenericRepository <Startup> startRepoo = unitOfWork.GetRepoInstance <Startup>(); User test = Session["USER"] as User; User user = userRepo.GetBy(u => u.UserID == test.UserID).FirstOrDefault(); Startup start = startRepoo.GetBy(s => s.CompanyID == test.UserID).FirstOrDefault(); RegisterModel prof = new RegisterModel(); prof.UserID = user.UserID; prof.CompanyID = start.CompanyID; prof.FirstName = user.FirstName; prof.LastName = user.LastName; prof.Mobile = user.Mobile; prof.CompanyName = start.CompanyName; prof.CompanyNumber = start.CompanyNumber; ViewBag.Profile = prof; ////////////////////////////////////////// ViewBag.TableName = "Escalated Cases"; return(View("EscalatedCasesList", model)); }
// GET: Portal/Case public ActionResult Dashboard() { long userId; if (Session["USER"] != null) { userId = ((User)Session["USER"]).UserID; } else { userId = 1; } //////////////////////////////Register Notification var currentTime = DateTime.Now; Session["LastUpdated"] = currentTime; NotificationComponent.SharedInstance.RegisterUser_Notification(currentTime, userId); ///////////////////////////////// int solvedCnt = 0, solvingCnt = 0, EscCnt = 0; unitOfWork = (GenericUnitOfWork)Session["UNITOFWORK"]; GenericRepository <Case> caseRepository = unitOfWork.GetRepoInstance <Case>(); Dashboard model = new Dashboard() { Closed = new List <Case>(), Current = new List <Case>(), Escalated = new List <Case>() }; GenericRepository <Priority> priority_caseRepository = unitOfWork.GetRepoInstance <Priority>(); //GenericRepository<Status> status_caseRepository = unitOfWork.GetRepoInstance<Status>(); GenericRepository <Category> category_caseRepository = unitOfWork.GetRepoInstance <Category>(); List <Priority> priorities = priority_caseRepository.GetAll().ToList(); List <Category> categories = category_caseRepository.GetAll().ToList(); ViewBag.Priorities = priorities; ViewBag.Categories = categories; NewCaseVM newcasevm = new NewCaseVM(); newcasevm.Case = new Case(); newcasevm.CaseID = newcasevm.Case.CaseID; model.newCaseVM = newcasevm; var result = caseRepository.GetBy(c => c.StartupID == userId).OrderBy(c => c.CategoryID); if (result.Count() != 0) { foreach (Case c in result) { if (c.StatusID == 1) { if (solvedCnt < 2) { model.Closed.Add(c); solvedCnt++; } } else if (c.StatusID == 2 || c.StatusID == 4) { if (solvingCnt < 2) { model.Current.Add(c); solvingCnt++; } } else { if (EscCnt < 2) { model.Escalated.Add(c); EscCnt++; } } } } GenericRepository <User> userRepo = unitOfWork.GetRepoInstance <User>(); GenericRepository <Startup> startRepoo = unitOfWork.GetRepoInstance <Startup>(); User test = Session["USER"] as User; User user = userRepo.GetBy(u => u.UserID == test.UserID).FirstOrDefault(); Startup start = startRepoo.GetBy(s => s.CompanyID == test.UserID).FirstOrDefault(); RegisterModel prof = new RegisterModel(); prof.UserID = user.UserID; prof.CompanyID = start.CompanyID; prof.FirstName = user.FirstName; prof.LastName = user.LastName; prof.Mobile = user.Mobile; prof.CompanyName = start.CompanyName; prof.CompanyNumber = start.CompanyNumber; //RegisterModel prof = new RegisterModel() //{ // UserID = user.UserID, // CompanyID = start.CompanyID, // FirstName = user.FirstName, // LastName = user.LastName, // //Email = user.Email, // Mobile = user.Mobile, // CompanyName = start.CompanyName, // CompanyNumber = start.CompanyNumber //}; ViewBag.Profile = prof; return(View(model)); }
public PatientAppointment(Object e) { InitializeComponent(); PatientInitTable(); dashboard = (Dashboard)e; }
public DashboardController(IDashboardService dashboardService, IHubContext <DashboardHub> hub) { _dashboard = dashboardService.Dashboard; _dashboardService = dashboardService; _hub = hub; }
public DashboardBuilder() { _dashboard = new Dashboard("Default", Guid.NewGuid()); }
#pragma warning disable 0618 public static void Migrate0(Dashboard dashboard, IDictionary <string, Guid> dashboardNameToID = null, IDictionary <string, Guid> scoreNameToID = null, IDictionary <string, Guid> penaltyNameToID = null) { Guid id; if (dashboard.Version != 0) { return; } if (dashboardNameToID == null) { dashboardNameToID = new Dictionary <string, Guid> (); } if (scoreNameToID == null) { scoreNameToID = new Dictionary <string, Guid> (); } if (penaltyNameToID == null) { penaltyNameToID = new Dictionary <string, Guid> (); } if (dashboard.ID == Guid.Empty) { if (!dashboardNameToID.TryGetValue(dashboard.Name, out id)) { dashboardNameToID [dashboard.Name] = id = Guid.NewGuid(); } dashboard.ID = id; } foreach (ScoreButton button in dashboard.List.OfType <ScoreButton> ()) { Score score = button.OldScore; if (!scoreNameToID.TryGetValue(score.Name, out id)) { scoreNameToID [score.Name] = id = Guid.NewGuid(); } var toAdd = button.EventType.Clone(); toAdd.ID = id; button.EventType = toAdd; button.ScoreEventType.Score = score; } foreach (PenaltyCardButton button in dashboard.List.OfType <PenaltyCardButton> ()) { PenaltyCard penalty = button.OldPenaltyCard; if (!penaltyNameToID.TryGetValue(penalty.Name, out id)) { penaltyNameToID [penalty.Name] = id = Guid.NewGuid(); } var toAdd = button.EventType.Clone(); toAdd.ID = id; button.EventType = toAdd; button.PenaltyCardEventType.PenaltyCard = penalty; } dashboard.Version = 1; }
/// <summary> /// Creates a new instance of the dashboard node. /// </summary> /// <param name="dashboard"> /// The owning dashboard. /// </param> /// <param name="xmlNode"> /// The xml node that contains the /// dashboard node definition. /// </param> /// <param name="parent"> /// The parent dashboard node. /// </param> public DashboardNodeMeasureLabel(Dashboard dashboard, XmlNode xmlNode, DashboardNode parent) : base(dashboard, xmlNode, parent) { }
void FillProjectDetails() { seasonentry.Text = project.Description.Season; competitionentry.Text = project.Description.Competition; datepicker1.Date = project.Description.MatchDate; desctextview.Buffer.Clear (); desctextview.Buffer.InsertAtCursor (project.Description.Description ?? ""); // In case the project provides a dashboard, use it, otherwise, enable the combobox if (project.Dashboard != null) { tagscombobox.Visible = false; analysislabel.Visible = false; analysisTemplate = project.Dashboard; } else { project.Dashboard = analysisTemplate; } // In case the project does have a team, do not allow a modification // otherwise set the loaded template if (project.LocalTeamTemplate != null) { hometeamscombobox.Sensitive = false; LoadTemplate (project.LocalTeamTemplate, TeamType.LOCAL, true); } else { project.LocalTeamTemplate = hometemplate; } if (project.VisitorTeamTemplate != null) { awayteamscombobox.Sensitive = false; LoadTemplate (project.VisitorTeamTemplate, TeamType.VISITOR, true); } else { project.VisitorTeamTemplate = awaytemplate; } mediafilesetselection1.Visible = true; mediafilesetselection1.FileSet = project.Description.FileSet; }
/// <summary> /// Checks the user exists. /// </summary> private void ValidateUserCredentials(object passwordDetails) { var passwordBox = passwordDetails as PasswordBox; Password = passwordBox.Password; bool isUserValidate = ServiceFactory.ServiceClient.ValidateUserCredentials(UserName, Password); if (!isUserValidate) { MessageVisibility = Visibility.Visible; } else { ////Sets the message visibility as hidden MessageVisibility = Visibility.Hidden; ////Opens up main window var mainWindow = new Dashboard(); mainWindow.Show(); ////Closes login window LoginWindow._LoginWindow.Close(); } }
public ControlDashboard(Dashboard dashboard) { Dashboard = dashboard; }
public void InsertOrUpdate(Dashboard entity) { if (entity.DashboardId == default(int)) // New entity { //context.Dashboards.Add(Dashboard); _context.Entry(entity).State = EntityState.Added; } else // Existing entity { _context.Entry(entity).State = EntityState.Modified; } }
public void SetAsMain(Dashboard dashboard) { if (dashboard.ActiveContent.Content == this) if (_chatWindow != null && EngagementContent.Content == _chatWindow) { Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() => { _chatWindow.messageBox.Focus(); Keyboard.Focus(_chatWindow.messageBox); })); } }
public async Task <IActionResult> Dashboard() { var dashboard = new Dashboard(); DateTime FechaPorDefecto = new DateTime(0001, 01, 01); var cantOfertas_x_Mes = new int[12]; var cantOfertVen_x_Mes = new int[12]; var contratosProximosVencer = new int[5]; var tiempoVenOfertas = context.TiempoVenOfertas.ToList(); var tiempoVenOferta = tiempoVenOfertas[0]; var ofertasContratos = context.Contratos.Where(c => c.FechaDeRecepcion.Year == DateTime.Now.Year); var contratos = context.Contratos.Where(c => c.FechaDeFirmado != FechaPorDefecto && c.AprobComitContratacion == true && c.Estado == Estado.Aprobado).ToList(); var ofertas = context.Contratos.Where(c => c.FechaDeFirmado == FechaPorDefecto && c.AprobComitContratacion == false && c.Estado != Estado.Aprobado); if (ofertas != null) { // Grafico Lineal Ofertas // for (int i = 0; i < 12; i++) { cantOfertas_x_Mes[i] = ofertas.Where(c => c.Estado != Estado.Cancelado && c.Estado != Estado.No_Aprobado && c.Estado != Estado.SinEstado && c.FechaDeRecepcion.Month == i + 1).Count(); cantOfertVen_x_Mes[i] = ofertas .Where(c => c.FechaDeRecepcion.Month == i + 1 && (c.FechaDeVenOferta - DateTime.Now).Days < tiempoVenOferta.OfertasVencidas).Count(); } dashboard.OfertasProceso = cantOfertas_x_Mes; dashboard.OfertasVencidas = cantOfertVen_x_Mes; // Grafico Lineal Ofertas// // Tabla Ofertas// dashboard.OfertasEnProceso = ofertas.Where(c => c.Estado != Estado.Cancelado && c.Estado != Estado.No_Aprobado && c.Estado != Estado.SinEstado).Count(); dashboard.OfertasVenHastaFecha = ofertas.Where(c => (c.FechaDeVenOferta - DateTime.Now).Days < tiempoVenOferta.OfertasVencidas).Count(); dashboard.OfertasVenEsteMes = ofertas.Where(c => c.FechaDeVenOferta.Month == DateTime.Now.Month && (c.FechaDeVenOferta - DateTime.Now).Days < tiempoVenOferta.OfertasVencidas).Count(); } dashboard.OfertasProcesadas = ofertasContratos.Where(c => c.FechaDeRecepcion.Year == DateTime.Now.Year).Count(); if (contratos != null) { double TiempoCirculacion = 0; double TiempoCirculacionMes = 0; foreach (var item in contratos) { TiempoCirculacion += (item.FechaDeFirmado - item.FechaDeRecepcion).Days; } foreach (var item in contratos.Where(c => c.FechaDeRecepcion.Month == DateTime.Now.Month)) { TiempoCirculacionMes += (item.FechaDeFirmado - item.FechaDeRecepcion).Days; } dashboard.PromCircuOferta = Math.Round(TiempoCirculacion / contratos.Count(), 0); dashboard.PromCircuOfertaMes = Math.Round(TiempoCirculacionMes / contratos .Where(c => c.FechaDeRecepcion.Month == DateTime.Now.Month).Count(), 0); // Tabla Ofertas// // Contratos Próximos a Vencer // contratosProximosVencer[0] = contratos.Where(c => c.FechaVenContrato.Month == DateTime.Now.Month).Count(); contratosProximosVencer[1] = contratos.Where(c => c.FechaVenContrato.Month == (DateTime.Now.Month + 1) || c.FechaVenContrato.Month == (DateTime.Now.Month + 2) || c.FechaVenContrato.Month == (DateTime.Now.Month + 3)).Count(); contratosProximosVencer[2] = contratos.Where(c => c.FechaVenContrato.Month == (DateTime.Now.Month + 1) || c.FechaVenContrato.Month == (DateTime.Now.Month + 2) || c.FechaVenContrato.Month == (DateTime.Now.Month + 3) || c.FechaVenContrato.Month == (DateTime.Now.Month + 4) || c.FechaVenContrato.Month == (DateTime.Now.Month + 5) || c.FechaVenContrato.Month == (DateTime.Now.Month + 6)).Count(); contratosProximosVencer[3] = contratos.Where(c => c.FechaVenContrato.Year == DateTime.Now.Year).Count(); contratosProximosVencer[4] = contratos.Where(c => c.FechaVenContrato.Year == DateTime.Now.Year + 1).Count(); dashboard.ContratosProximosVencer = contratosProximosVencer; // Contratos Próximos a Vencer // } return(Ok(dashboard)); }
/// <summary> /// Creates a new instance of the dashboard node. /// </summary> /// <param name="dashboard"> /// The owning dashboard. /// </param> /// <param name="xmlNode"> /// The xml node that contains the /// dashboard node definition. /// </param> /// <param name="parent"> /// The parent dashboard node. /// </param> public DashboardNodeFilter(Dashboard dashboard, XmlNode xmlNode, DashboardNode parent) : base(dashboard, xmlNode, parent) { }
public async Task <ResponseData <Dashboard> > Index(string accountid, string applianceid) { try { var accountAppliance = _accountApplianceService.GetAccountApplianceByAccountId(Convert.ToInt64(accountid)); var _event = _eventService.GetEventByApplianceId(Convert.ToInt64(applianceid)); var lAccounts = _accountApplianceService.GetAccountByApplianceId(Convert.ToInt64(applianceid), true); List <AccountApplianceDTO> accountApplianceDTO = new List <AccountApplianceDTO>(); if (accountAppliance != null && accountAppliance.Count > 0) { foreach (var item in accountAppliance) { accountApplianceDTO.Add(new AccountApplianceDTO(item)); } } lAccounts = lAccounts.Where(x => x.Id != Convert.ToInt64(accountid)).ToList(); if (!TelitApi.IsConnected) { TelitApi.CheckIOTConnection().Wait(); } var appliance = _applianceService.GetApplianceById(Convert.ToInt64(applianceid)); var thingFind = await TelitApi.ThingFind(appliance.SerialNumber); Telit.ThingFind.Params _params = new Telit.ThingFind.Params(); string applianceEnvironment = string.Empty; ApplianceDTO applianceDTO = new ApplianceDTO(); if (thingFind != null && thingFind.Things != null && thingFind.Things.success && thingFind.Things.@params != null) { _params = thingFind.Things.@params; } if (_params != null && _params.alarms != null && _params.alarms.env != null && _params.alarms.env.state >= 0 && _params.alarms.env.state < 16) { applianceEnvironment = Convert.ToString(_params.alarms.env.state, 2).PadLeft(4, '0'); var array = !string.IsNullOrEmpty(applianceEnvironment) ? applianceEnvironment.ToArray() : new char[] { }; applianceDTO.Cellular = array.Length == 4 ? Convert.ToBoolean(Convert.ToInt16(array[2].ToString())) : false; applianceDTO.Power = array.Length == 4 ? Convert.ToBoolean(Convert.ToInt16(array[3].ToString())) : false; applianceDTO.Wifi = array.Length == 4 ? Convert.ToBoolean(Convert.ToInt16(array[1].ToString())) : false; applianceDTO.WiFiInternet = array.Length == 4 ? Convert.ToBoolean(Convert.ToInt16(array[0].ToString())) : false; } applianceDTO.TimerEnabled = _params != null && _params.alarms != null && _params.alarms.timerState != null ? (Convert.ToInt64(_params.alarms.timerState.state) != 0 ? true : false) : false; applianceDTO.DeviceName = _params != null && _params.attrs != null && _params.attrs.name != null ? _params.attrs.name.value : appliance.DeviceName; applianceDTO.SerialNumber = appliance.SerialNumber; applianceDTO.TriggerMile = appliance.TriggerMile; applianceDTO.Id = appliance.Id; applianceDTO.IsOn = _params != null && _params.alarms != null && _params.alarms.on != null?CheckApplianceIsOn(Convert.ToInt16(_params.alarms.on.state)) : false; applianceDTO.IsConnected = _params.connected; applianceDTO.Lat = appliance.Lat; applianceDTO.Lon = appliance.Lon; applianceDTO.GeoFenceEnabled = appliance.GeoFenceEnabled; applianceDTO.Status = appliance.Status; if (_params != null && _params.alarms != null) { applianceDTO.TrustLevel = _params.alarms.trust != null ? (int?)_params.alarms.trust.state : 3; } var plans = _stripeService.GetPlans(); var subscriptionId = _accountApplianceService.GetAccountApplianceByAccountIdAndApplianceId(Convert.ToInt64(accountid), Convert.ToInt64(applianceid)); DateTime?expireDate = null; bool cancelAtEnd = false; if (subscriptionId != null && !string.IsNullOrEmpty(subscriptionId.SubscriptionId)) { var stripe = _stripeService.RetrieveSubscription(subscriptionId.SubscriptionId); // current period end expireDate = stripe.CurrentPeriodEnd; cancelAtEnd = stripe.CancelAtPeriodEnd; } var dashboard = new Dashboard() { AccountAppliance = accountApplianceDTO, Events = _event, ListAccountsDTO = lAccounts, IsIOTConnected = TelitApi.IsConnected, Plans = plans, AppDTO = applianceDTO, ExpireDate = expireDate, CancelAtEnd = cancelAtEnd, IsApplianceConnected = applianceDTO.IsConnected.Value }; var response = new ResponseData <Dashboard>(); response.Data = dashboard; response.Message = ResponseMessage.Success; response.Status = ResponseStatus.Success.ToString(); return(response); } catch (Exception ex) { var response = new ResponseData <Dashboard>(); response.Message = ex.Message; response.Status = ResponseStatus.Error.ToString(); return(response); } }
public Display() { ShowIssue = new ShowIssue(); Dashboard = new Dashboard(); }
/// <summary> /// Initializes a new instance of the <see cref="DashboardDecryptor"/> class. /// </summary> /// <param name="encryptedDashboard">The encrypted dashboard.</param> public DashboardDecryptor(Dashboard encryptedDashboard) { var seed = Convert.FromBase64String(encryptedDashboard.Key); var salt = Convert.FromBase64String(encryptedDashboard.Salt); this.key = EncryptionHelper.GenerateAesKeyFromSeed(seed, salt); }
public void ThenUIMenuIsNotVisible() { Dashboard.UiMenuIsNotVisible(); }
public ActionResult Edit(Dashboard dashboard) { //[Bind(Include = "DashboardId,Name,Description,SharedWithId,OwnerId,ModifiedDate,ParentId,DashboardTypeId")] if (ModelState.IsValid) { dashboard = _dashboardRepository.AllIncluding(c => c.Dashboard_Users) .Where(d => d.DashboardId == dashboard.DashboardId) .FirstOrDefault(); dashboard.Dashboard_Users.Where(c => c.UserId == _currentUser.User.Id).FirstOrDefault().Favorite = true; _dashboardRepository.InsertOrUpdate(dashboard); _dashboardRepository.Save(); return RedirectToAction("Index", new { name = dashboard.Name }); } return RedirectToAction("Index"); }
public async Task <Opportunity> CreateWorkflowAsync(Opportunity opportunity, string requestId = "") { _logger.LogInformation($"RequestId: {requestId} - CreateDashBoardEntryAsync called."); try { var targetDate = opportunity.Metadata.Fields.ToList().Find(x => x.DisplayName == "Target Date")?.Values; var openedDate = opportunity.Metadata.Fields.ToList().Find(x => x.DisplayName == "Opened Date")?.Values; if (targetDate != null && openedDate != null) { var entity = new Dashboard(); entity.CustomerName = opportunity.Metadata.Customer.DisplayName.ToString(); entity.Status = opportunity.Metadata.OpportunityState.Name.ToString(); entity.StartDate = openedDate ?? String.Empty; entity.OpportunityName = opportunity.DisplayName.ToString(); entity.OpportunityId = opportunity.Id; entity.Id = String.Empty; entity.TotalNoOfDays = 0; entity.ProcessList = new List <DashboardProcessList>(); entity.ProcessEndDateList = new List <DashboradProcessEndDateList>(); entity.ProcessLoanOfficerNames = new List <DashboardLoanOfficers>(); var processList = (await _processRepository.GetAllAsync(requestId)).ToList(); foreach (var process in processList) { if (process.ProcessType.ToLower() == "checklisttab") { entity.ProcessList.Add(new DashboardProcessList { ProcessName = process.Channel.ToLower(), ProcessEndDate = string.Empty, ProcessStartDate = string.Empty, NoOfDays = 0 }); entity.ProcessEndDateList.Add(new DashboradProcessEndDateList { Process = process.Channel.ToLower() + "enddate", EndDate = string.Empty }); } } var loanOfficerAdgroup = opportunity.Content.TeamMembers.FirstOrDefault(mem => mem.Fields.Permissions.Any(per => per.Name.ToLower() == "opportunity_readwrite_dealtype")); entity.ProcessLoanOfficerNames.Add(new DashboardLoanOfficers { AdGroupName = loanOfficerAdgroup != null ? loanOfficerAdgroup.RoleName.ToString():string.Empty, OfficerName = loanOfficerAdgroup != null ? loanOfficerAdgroup.DisplayName.ToString() : string.Empty }); await _dashboardRepository.CreateOpportunityAsync(entity, requestId); } } catch (Exception ex) { _logger.LogError($"RequestId: {requestId} - CreateDashBoardEntryAsync Service Exception: {ex}"); } return(opportunity); }
void HandleOpenedProjectChanged(OpenedProjectEvent e) { this.analysisWindow = e.AnalysisWindow as IAnalysisWindow; capturer = e.AnalysisWindow.Capturer; player = e.AnalysisWindow.Player; openedProject = e.Project as ProjectLongoMatch; this.projectType = e.ProjectType; if (e.Project == null) { dashboard = null; } else { dashboard = e.Project.Dashboard; } ReloadHotkeys (); }
public void ThenThereShouldBeMoreResults() { Dashboard.LoadMoreResults(); }
// Load and and intialize the Dashboard. private void Dashboard_Loaded(object sender, RoutedEventArgs e) { Dashboard.Init(); }
public void WhenCheckboxIsUnchecked() { Dashboard.CheckboxIsUnchecked(); }
void HandleSportsTemplateChanged(object sender, EventArgs e) { analysisTemplate = Config.CategoriesTemplatesProvider.Load (tagscombobox.ActiveText); if (teamtagger != null) { teamtagger.LoadTeams (hometemplate, awaytemplate, analysisTemplate.FieldBackground); } }
public void AcceptLogVisitor(Dashboard visitor) { visitor.LogStatus("Right foot", _isOn); visitor.LogMaxCharge(_maxCharge); }
private void LoginAction(object obj) { if (obj == null) { ErrorMessage = "null object error"; return; } PM = Trader = Admin = false; List <Role> role = Entity.Roles.ToList(); var parameters = (object[])obj; dynamic password = parameters[1]; Login_Model.Login cred = parameters[0] as Login_Model.Login; if (String.IsNullOrEmpty(cred.UserName) || String.IsNullOrEmpty(password.Password.ToString())) { ErrorMessage = String.IsNullOrEmpty(cred.UserName) ? "Username can not be empty !!" : "Password can not be empty !!"; return; } cred.Password = password.Password; List <User_Role> urole = Entity.User_Role.ToList(); List <User> users = Entity.Users.ToList(); if (users.Exists(u => (u.UserName == cred.UserName))) { User u = users.First(u2 => (u2.UserName == cred.UserName)); if (u.PassWord == cred.Password) { if (u.ISActive) { Session.CurrentUser = u; List <User_Role> roles = urole.FindAll(user => (user.UserID == u.UserID)); foreach (var item in roles) { switch (item.RoleID) { case 1: PM = true; break; case 2: Trader = true; break; case 3: Admin = true; break; } } if (roles.Count > 1) { var oldCurrentWindow = App.Current.MainWindow; //App.Current.MainWindow.Hide(); SelectPage sp = new SelectPage(); App.Current.MainWindow = sp; App.Current.MainWindow.Show(); //sp.Show(); oldCurrentWindow.Close(); } else { if (PM) { var oldCurrentWindow = App.Current.MainWindow; //App.Current.MainWindow.Hide(); Dashboard d = new Dashboard(); App.Current.MainWindow = d; App.Current.MainWindow.Show(); Session.CurrentRole = Entity.Roles.Find(2); oldCurrentWindow.Close(); } else if (Trader) { var oldCurrentWindow = App.Current.MainWindow; //App.Current.MainWindow.Hide(); TraderDashboard d = new TraderDashboard(); App.Current.MainWindow = d; App.Current.MainWindow.Show(); Session.CurrentRole = Entity.Roles.Find(1); oldCurrentWindow.Close(); } else if (Admin) { var oldCurrentWindow = App.Current.MainWindow; //App.Current.MainWindow.Hide(); Dashboard_Admin d = new Dashboard_Admin(); App.Current.MainWindow = d; App.Current.MainWindow.Show(); Session.CurrentRole = Entity.Roles.Find(3); oldCurrentWindow.Close(); } } } } else { ErrorMessage = "Invalid UserName/Password"; return; } } else { ErrorMessage = "Invalid UserName/Password"; return; } }
public ActionResult GetChartForSelectedNode(string nodeid, string nodetext) { Plant plant = new Plant(); try { int row; int a = getIndexofNumber(nodeid); string NodeNumber = nodeid.Substring(a, nodeid.Length - a); row = Convert.ToInt32(NodeNumber); string NodeType = nodeid.Substring(0, a); switch (NodeType) { case "Plant": { ViewBag.Title = nodetext.ToString(); TempData["SelectedNodeID"] = nodeid; ArrayList AreaList = GetAreasForPlant("Plant", nodeid); return(PartialView("_pieChart", Dashboard.GetPieChartData(NodeType, AreaList))); } case "Area": { ViewBag.Title = nodetext.ToString(); TempData["SelectedNodeID"] = nodeid; ArrayList TrainList = GetTrainForArea("Area", nodeid); return(PartialView("_pieChart", Dashboard.GetPieChartData(NodeType, TrainList))); } case "Train": { ViewBag.Title = nodetext.ToString(); TempData["SelectedNodeID"] = nodeid; ArrayList MachineList = GetMachinesForTrain("Train", nodeid); return(PartialView("_pieChart", Dashboard.GetPieChartData(NodeType, MachineList))); } case "Machine": { ViewBag.Title = nodetext.ToString(); TempData["SelectedNodeID"] = nodeid; ArrayList PointList = GetPointsForMachine("Machine", nodeid); return(PartialView("_pieChart", Dashboard.GetPieChartData(NodeType, PointList))); } case "Point": { ViewBag.Title = nodetext.ToString(); TempData["SelectedNodeID"] = nodeid; List <RecordedData> lstRecordData = GetRecordDataForPoint(nodeid); return(PartialView("_pointView", TrendDashboard.GetLineChartDataWithNullValues(lstRecordData))); } default: { ArrayList AreaList = GetAreasForPlant("Plant", nodeid); return(PartialView("_pieChart", Dashboard.GetPieChartData(NodeType, AreaList))); } } } catch (Exception ex) { throw ex; } //return PartialView("_pieChart", Dashboard.GetPieChartData()); }
/// <summary> /// Maps the dashboard details. /// </summary> /// <param name="dashboard">The dashboard.</param> /// <returns>Dashboard details</returns> private static AlertsAndMessagesDetail MapDashboardDetails(Dashboard dashboard) { var dashboardDetails = new AlertsAndMessagesDetail(); if (dashboard != null) { dashboardDetails.ActiveAlerts = Convert.ToString(dashboard.AlertSummary.Active, CultureInfo.InvariantCulture); dashboardDetails.CreatedAlerts = Convert.ToString(dashboard.AlertSummary.Created, CultureInfo.InvariantCulture); dashboardDetails.CreatedMessages = Convert.ToString(dashboard.MessageSummary.Created, CultureInfo.InvariantCulture); dashboardDetails.UnreadMessages = Convert.ToString(dashboard.MessageSummary.Unread, CultureInfo.InvariantCulture); } return dashboardDetails; }
/// <summary> /// Creates a new instance of the dashboard node. /// </summary> /// <param name="dashboard"> /// The owning dashboard. /// </param> /// <param name="xmlNode"> /// The xml node that contains the /// dashboard node definition. /// </param> public DashboardNodeFilter(Dashboard dashboard, XmlNode xmlNode) : base(dashboard, xmlNode) { }