protected void Grid_HostList_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem DataItem = e.Item as GridDataItem; int hostid = Convert.ToInt32(DataItem["DormitoryHostId"].Text.ToString()); int status = Convert.ToInt32(DataItem["HostStatus"].Text.ToString().Trim()); DataItem["HostStatus"].Text = DormitoryHostStatus(status); //School and Campus var cHostSchool = new CDormitoryHostPreferredSchool(); DormitoryHostPrefferedSchool hostTopSchool = cHostSchool.GetHostTopSchool(hostid); SiteLocation HostSchoolLocation = cHostSchool.GetHostTopShoolNameLocation(Convert.ToInt32(hostTopSchool.SiteLocationId)); var cSite = new CSite(); Site SchoolName = cSite.Get(Convert.ToInt32(HostSchoolLocation.SiteId)); RadLabel lblTopShool = (RadLabel)DataItem.FindControl("lbl_HostTopSchool"); lblTopShool.Text = SchoolName.Abbreviation.ToString(); RadLabel lblTopCampus = (RadLabel)DataItem.FindControl("lbl_HostTopCampus"); lblTopCampus.Text = HostSchoolLocation.City.ToString(); //Room Number RadLabel lblRoomNumber = (RadLabel)DataItem.FindControl("lbl_RoomNumber"); var cHostRoom = new CDormitoryHostRoom(); int RoomNumber = 0; RoomNumber = cHostRoom.GetDormitoryHostRoomNumber(hostid); lblRoomNumber.Text = RoomNumber.ToString(); //Bed Number RadLabel lblBedNumber = (RadLabel)DataItem.FindControl("lbl_BedNumber"); var cHostBed = new CDormitoryHostBed(); int BedNumber = 0; BedNumber = cHostBed.GetDormitoryHostBedNumber(hostid); lblBedNumber.Text = BedNumber.ToString(); } }
public static Hashtable GetElementsAPrendreEnCoursPourChemins(CSchemaReseau schema, CSite siteOrigine, CSite siteDestination) { Hashtable tableElementsAPrendreEnCompte = new Hashtable(); CGraphe graphe = new CGraphe(); graphe.CreateGraphe(schema); CSpvSite spvOrigine = CSpvSite.GetObjetSpvFromObjetTimos(siteOrigine); CSpvSite spvDest = CSpvSite.GetObjetSpvFromObjetTimos(siteDestination); if (spvDest != null) { List <CChemin> chemins = graphe.GetChemins(spvOrigine, spvDest); foreach (CChemin chemin in chemins) { foreach (CPassageChemin passage in chemin.Passages) { tableElementsAPrendreEnCompte[passage.SiteSource] = true; if (passage.LiaisonUtilisee != null) { tableElementsAPrendreEnCompte[passage.LiaisonUtilisee] = true; } } } } return(tableElementsAPrendreEnCompte); }
private void Init(CSite site) { m_site = site; m_lblNomSite.Text = m_site.Libelle; FillListeChildSite(); FillEquipements(); }
public static void StartReleve(CSite site) { if (site == null) { return; } CReleveDb releveDb = CTimosInventoryDb.GetInventaireDatas(); releveDb.AcceptChanges(); //Cherche le relevé dans la base CReleveSite releve = new CReleveSite(releveDb); if (!releve.ReadIfExist(new CFiltreMemoryDb( CSite.c_champId + "=@1", site.Id))) { releve = CReleveSite.GetNewReleve(releveDb, site); } CFormReleveSite form = new CFormReleveSite(); form.m_releve = releve; form.ShowDialog(); form.Dispose(); }
private static void AddDetailSiteToDb(CSite siteTimos, TID.CSite siteParent, CMemoryDb db) { TID.CSite site = new TimosInventory.data.CSite(db); site.CreateNew(siteTimos.Id); site.Libelle = siteTimos.Libelle; site.Row[TID.CTypeSite.c_champId] = siteTimos.Row[CTypeSite.c_champId.ToString()]; site.SiteParent = siteParent; site.CodeOptionsControleCoordonnees = siteTimos.OptionsControleCoordonneesPropreInt; CParametrageSystemeCoordonnees paramTimos = siteTimos.ParametrageCoordonneesApplique; TID.CParametrageSystemeCoordonnees parametrage = ImporteParametrageSC( paramTimos, db, null, null); if (parametrage != null) { parametrage.Site = site; } foreach (CSite siteFils in siteTimos.SitesFils) { AddDetailSiteToDb(siteFils, site, db); } }
//-------------------------------------------------------------------------------------------- private void m_lnkAjouterSite_LinkClicked(object sender, EventArgs e) { if (m_txtSelectSite.ElementSelectionne == null) { return; } CSite site = (CSite)m_txtSelectSite.ElementSelectionne; CListeObjetsDonnees listeRelSites = m_ticketEdite.RelationsSitesListe; listeRelSites.Filtre = new CFiltreData(CSite.c_champId + " = @1 ", site.Id); if (listeRelSites.Count != 0) { CFormAlerte.Afficher(I.T("This Site is already in the list|1110"), EFormAlerteType.Exclamation); return; } m_txtSelectSite.ElementSelectionne = null; CRelationTicket_Site newRel = new CRelationTicket_Site(m_ticketEdite.ContexteDonnee); newRel.CreateNewInCurrentContexte(); newRel.Ticket = m_ticketEdite; newRel.Site = site; InitListeSites(); }
private void AfficheHistorique() { m_panelInfoSite.Visible = false; DataGridViewCell cell = m_grid.CurrentCell; if (m_grid.SelectedCells.Count == 1 && cell != null) { DataRowView rowView = m_grid.CurrentRow.DataBoundItem as DataRowView; if (rowView != null) { DataRow row = rowView.Row; int nCol = cell.ColumnIndex; DataColumn col = m_dataTable.Columns[m_grid.Columns[nCol].DataPropertyName]; if (col != null) { CTypeTicketContrat tt = col.ExtendedProperties[typeof(CTypeTicketContrat)] as CTypeTicketContrat; if (tt != null) { int nIdSite = (int)row["SITE_ID"]; CSite site = m_faciliteurEditePeriode.GetSite(nIdSite); m_lblSite.Text = site.Libelle; m_lblTypeTicket.Text = tt.TypeTicket.Libelle; m_panelInfoSite.Visible = true; CTypeTicketContrat_Site ts = tt.GetRelationSite(nIdSite); FillHistorique(ts == null?null:(CTypeTicketContrat_Site_Periode[])ts.Periodes.ToArray(typeof(CTypeTicketContrat_Site_Periode))); return; } } } } }
//--------------------------------------------- public override object[] GetObjets(CNodeConsultationHierarchique nodeParent, sc2i.data.CContexteDonnee contexteDonnee) { List <CSchemaReseau> lstCablages = new List <CSchemaReseau>(); CSite site = m_schemaCablage.SiteApparenance; if (site != null) { CSchemaReseau schemaParent = m_schemaCablage.SchemaParent; if (schemaParent != null) { IEnumerable <CLienReseau> lstLiens = from elt in schemaParent.GetElementsForType <CLienReseau>() where elt.LienReseau.Site1 == site || elt.LienReseau.Site2 == site select elt.LienReseau; foreach (CLienReseau lien in lstLiens) { CSchemaReseau schema = lien.SchemaReseau; if (schema != null) { foreach (CSchemaReseau sche in schema.SchemaFils) { if (sche.SiteApparenance == site) { lstCablages.Add(sche); } } } } } } return(lstCablages.ToArray()); }
public string _AddGroupingInfo(CService server, string name, int type, string parent, string id = "") { if (!DiscoveredGroups.ContainsKey(name)) { if (id != null && id == parent) { parent = ""; } // object = parent: so parent may as well be empty DiscoveredGroups.Add(name, new CDiscoveredConfig() { Name = name, Type = type, Owner = new List <string> { parent } }); if (id != null && id != "") { DiscoveredGroups[name].Id = id; } // if id is specified specifically set this for the group if (DiscoveredGroups[name].Attributes == null) { DiscoveredGroups[name].Attributes = new CDiscoveredAttributes(); } if (DiscoveredGroups[name].Metrics == null) { DiscoveredGroups[name].Metrics = new CDiscoveredMetrics(); } if (type == CDiscoveredTypes.Site) { CSite obj = DiscoveredSites.Find(x => x.Name.Equals(name)); if (obj != null) { DiscoveredGroups[name].Attributes.Set(CAttributeType.Details, obj.Description.ToStringNz()); DiscoveredGroups[name].Attributes.Set(CAttributeType.Path, obj.Path.ToStringNz()); DiscoveredGroups[name].Attributes.Set(CAttributeType.Location, obj.Location.ToStringNz()); DiscoveredGroups[name].Attributes.Set(CAttributeType.Subnets, CFunctions.StringJoin(";", obj.Subnets)); } } else if ((type == CDiscoveredTypes.VICluster)) { if (DiscoveredGroups.ContainsKey(server.Name)) { DiscoveredGroups[server.Name].Metrics.Increment(CMetricType.ClCount, 1); } } else if ((type == CDiscoveredTypes.HVCluster)) { DiscoveredGroups[name].Metrics.Increment(CMetricType.ClCount, 1); } else if ((type == CDiscoveredTypes.VIDatacenter) || (type == CDiscoveredTypes.HVDatacenter)) { if (DiscoveredGroups.ContainsKey(server.Name)) { DiscoveredGroups[server.Name].Metrics.Increment(CMetricType.DcCount, 1); } } return(DiscoveredGroups[name].Id); } return(null); }
private CResultAErreur AjouterOperation(COperation operation, COperation opParente) { CResultAErreur result = CResultAErreur.True; CSite site = (CSite)Intervention.ElementAIntervention; if (operation.TypeOperation != null && operation.TypeOperation.IsLieeAEquipement && operation.TypeOperation.GenererUneOpParTypeEquipement) { CTypeEquipement typeEqpt = operation.TypeEquipement; if (typeEqpt != null && site != null) { CListeObjetsDonnees listeEqpt = site.Equipements; listeEqpt.Filtre = new CFiltreData(CTypeEquipement.c_champId + "=@1", typeEqpt.Id); if (listeEqpt.Count == 0) { result.EmpileErreur(I.T("The Site '@1' has no equipment type '@2' specified by Operation '@3'|431", site.Libelle, operation.TypeEquipement.Libelle, operation.TypeOperation.Libelle)); } else { foreach (CEquipement equip in listeEqpt) { result = operation.CreerOperationPrevisionnelleSurIntervention(Intervention, equip); IsBasculeEnOperationsPrev = true; if (result) { foreach (COperation ssOp in operation.OperationsFilles) { result = AjouterOperation(ssOp, opParente); } } } } } } else { result = operation.CreerOperationPrevisionnelleSurIntervention(Intervention); if (result) { COperation op = result.Data as COperation; if (op != null) { op.OperationParente = opParente; foreach (COperation opFille in operation.OperationsFilles) { result = AjouterOperation(opFille, op); if (!result) { return(result); } } } } IsBasculeEnOperationsPrev = true; } return(result); }
protected void Login_Click(object sender, EventArgs e) { if (IsValid) { var cUser = new CUser(); var user = cUser.Get(tbUsername.Text.Trim()); if (user != null) { if (CCryptography.DecryptCipherTextToPlainText(user.Password.Trim()) == tbPassword.Text.Trim()) { if (user.IsActive) { btLogin.Enabled = false; Session["UserId"] = user.UserId; Session["SiteLocationId"] = user.SiteLocationId; var siteLocation = (new CSiteLocation()).Get(user.SiteLocationId); if (siteLocation != null) { Session["SiteId"] = siteLocation.SiteId; Session["SiteName"] = new CSite().Get(siteLocation.SiteId)?.Abbreviation; Session["SiteLocationName"] = siteLocation.Name; } Session["UserName"] = cUser.GetUserName(user); Session["UserPositionId"] = user.UserPositionId; var userPosition = (new CUserPosition()).Get(user.UserPositionId); if (userPosition != null) { Session["UserGroupId"] = userPosition.UserGroupId; } var userPermissionModelList = (new CUserPermission()).GetUserPermissionModelList(user.UserId); Session["UserPermissionModelList"] = userPermissionModelList; RadAjaxPanel1.Redirect("~/Dashboard"); } else { ShowMessage("Your account is disabled<br /><br />Please contact administrator."); } // set cookie WriteCookie("IsKeepSign", RadButtonKeepSign.Checked ? "1" : "0"); if (RadButtonKeepSign.Checked) { WriteCookie("Username", tbUsername.Text.Trim()); } } else { ShowMessage("Wrong Password<br /><br />Please try again!"); } } else { ShowMessage("Invalid Login Id<br /><br />Please try again!"); } } }
public static void ShowSite(CSite site) { CFormDetailSite form = new CFormDetailSite(); form.Init(site); form.ShowDialog(); form.Dispose(); }
public CNoeudDeGrapheReseauSite GetNoeudForSite(CSite site, CSchemaReseau schema) { if (site == null || schema == null) { return(null); } return(m_baseNoeuds.GetObjet(typeof(CNoeudDeGrapheReseauSite), site.Id, schema.Id) as CNoeudDeGrapheReseauSite); }
//------------------------------------------------------------------------- private void InitSelectTypeEquipementRemplace() { CSite site = (CSite)m_operation.FractionIntervention.Intervention.ElementAIntervention; CListeObjetsDonnees listeEqpt = site.Equipements; m_selectTypeEquipementRemplace.Init <CTypeEquipement>( "Libelle", true); }
//---------------------------------------------------------------------- public void TiagSetSiteKeys(object[] lstCles) { CSite site = new CSite(ContexteDonnee); if (site.ReadIfExists(lstCles)) { Site = site; } }
public bool AssocieAuSite(CSite site) { if (m_cacheIdsSitesAssocies == null) { GetTousLesSitesAssocies(true); } return(m_cacheIdsSitesAssocies.Contains(site.Id.ToString())); }
public RCertification(int invoiceId) { // // Required for telerik Reporting designer support // InitializeComponent(); var invoice = new CInvoice().Get(invoiceId); if (invoice?.ProgramRegistrationId == null) { return; } var programRegistration = new CProgramRegistration().Get((int)invoice.ProgramRegistrationId); if (programRegistration == null) { return; } var cStudent = new CStudent(); var student = cStudent.Get((int)invoice.StudentId); if (student == null) { return; } var program = new CProgram().Get(programRegistration.ProgramId); var siteLocation = new CSiteLocation().Get(student.SiteLocationId); var site = new CSite().Get(siteLocation.SiteId); var weeks = programRegistration.Weeks == null ? string.Empty : programRegistration.Weeks + " weeks"; var programDescription = program.ProgramFullName + (programRegistration.HrsStatus != null ? $"({programRegistration.HrsStatus}/week)" : string.Empty) + " Program"; htmlTextBoxBody.Value = $@"This Certification awarded to<br> <b>{cStudent.GetStudentFullName(student)}</b><br> for successfully completing {weeks} in the<br> <b>{programDescription}</b><br> at {site.Name}, {siteLocation.Name}, ON, Canada"; htmlTextBoxDate.Value = $"Dated : <b>{DateTime.Today.ToString("MM-dd-yy")}</b>"; try { var signPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.Sign); if (signPath != string.Empty) { pictureBoxSign.Value = Image.FromFile(signPath); } } catch (Exception ex) { Debug.Print(ex.Message); } }
public override IElementDeSchemaReseau GetElementAssocie(CContexteDonnee contexte) { CSite site = new CSite(contexte); if (site.ReadIfExists(IdSite)) { return(site); } return(null); }
//------------------------------------------------------- public static CReleveSite GetNewReleve(CReleveDb db, CSite site) { CReleveSite releve = new CReleveSite(db); releve.CreateNew(); releve.DateReleve = DateTime.Now; releve.Site = site; releve.InitEquipementsReleves(); return(releve); }
private void m_wndListeSites_ItemClick(ListViewItem item) { CSite site = item.Tag as CSite; if (site != null) { CFormDetailSite.ShowSite(site); InitListeReleves(); } }
//------------------------------------------------------------------------------------ /// <summary> /// Assure l'exostance d'un Host partir des données fournies. /// Créé l'équipemtn logique du bon type si le Host n'existe pas /// </summary> /// <param name="strHostId"></param> /// <param name="strType"></param> /// <param name="strName"></param> /// <returns></returns> private static CResultAErreur AssureHostExiste(string strHostId, string strType, string strName, CContexteDonnee contexte) { CResultAErreur result = CResultAErreur.True; // Vérifie si le host existe ans Timos CTypeEquipement typeEquipement = new CTypeEquipement(contexte); result = CCamusatQowisioData.GetEquipementLogiqueFromQowisioId(strHostId, contexte); if (!result) { return(result); } CEquipementLogique qowisioBox = result.Data as CEquipementLogique; if (strType == "SITE" && typeEquipement.ReadIfExists(CCamusatQowisioData.c_nIdTypeEquipementQowisioVirtualSite)) { // C'est trouvé, rien à faire de plus } else if (strType == "PICKUP" && typeEquipement.ReadIfExists(CCamusatQowisioData.c_nIdTypeEquipementQowisioBoxVehicule)) { // Trouvé } else { result.EmpileErreur("No Equipment Type found for Host Id : " + strHostId); return(result); } if (qowisioBox == null) { // Créer un nouvel equipement logique Timos CSite siteAwaitingElements = new CSite(contexte); if (siteAwaitingElements.ReadIfExists(CCamusatQowisioData.c_nIdSiteQowisionAwaitingElements)) { qowisioBox = new CEquipementLogique(contexte); qowisioBox.CreateNewInCurrentContexte(); qowisioBox.TypeEquipement = typeEquipement; qowisioBox.Site = siteAwaitingElements; qowisioBox.SetValeurChamp(CCamusatQowisioData.c_nIdChampTimosQowisioId, strHostId); qowisioBox.Libelle = strName; } else { result.EmpileErreur("No Site found for awaiting elements. Host Id : " + strHostId); return(result); } } else { qowisioBox.TypeEquipement = typeEquipement; } result.Data = qowisioBox; return(result); }
public void setProduct(string sSymbol, CSite site, string sLogicID, double dContractSize) { if (m_product == null) { m_product = new CProduct(); } m_product.setSymbol(sSymbol); m_product.setSite(site); m_product.setLogicID(sLogicID); m_product.setContractSize(dContractSize); }
public override object Invoke(object objetAppelle, params object[] parametres) { CSite site = objetAppelle as CSite; if (site == null) { return(null); } return(CMethodeSupplementaireSelectLastSiteDataAt.GetDataAt(site, null, false)); }
public bool MappageSiteListeInterExistant(CSite site) { foreach (int nIdSite in m_mappageSiteListeInter.Keys) { if (nIdSite == site.Id) { return(true); } } return(false); }
public CInterventionPourEditeurPreventive(string label, CSite site, List <CListeOperations> listeOp, DateTime dateDebut, DateTime dateFin, CTypeIntervention typeinter) { m_dateFin = dateFin; m_dateDebut = dateDebut; m_label = label; m_site = site; m_listeOp = listeOp; m_typeInter = typeinter; m_inter = null; m_bRemove = false; }
//------------------------------------------------- private void InitComboEquipementParent(CComboBoxArbreObjetDonneesHierarchique combo) { CSite site = null; CStock stock = null; if (combo == m_cmbEquipement) { site = m_selectSite.ElementSelectionne as CSite; } if (combo == m_cmbEquipementStock) { stock = m_selectStock.ElementSelectionne as CStock; } combo.LockEdition = true; if (m_equipement.TypeEquipement != null) { //Récupère les équipements du site qui peuvent contenir cet équipement CTypeEquipement[] equips = m_equipement.TypeEquipement.TousLesTypesIncluants; string strIds = ""; foreach (CTypeEquipement type in equips) { strIds += type.Id + ","; } if (strIds != "") { strIds = strIds.Substring(0, strIds.Length - 1); CFiltreData filtreRacine = null; if (site != null) { filtreRacine = new CFiltreData( CSite.c_champId + "=@1", site.Id); } else if (stock != null) { filtreRacine = new CFiltreData( CStock.c_champId + "=@1", stock.Id); } else { filtreRacine = new CFiltreDataImpossible(); } CFiltreData filtre = new CFiltreData( CTypeEquipement.c_champId + " in (" + strIds + ") "); filtre = CFiltreData.GetAndFiltre(filtreRacine, filtre); combo.Init(typeof(CEquipement), "EquipementsContenus", CEquipement.c_champIdEquipementContenant, "Libelle|" + CEquipement.c_strCleFormuleGlobaleLibelleEquipement, filtre, filtreRacine); combo.LockEdition = false; } } }
internal void InitForSite(CSite site) { m_nIdSite = site.Id; CSpvSite spvSite = CSpvSite.GetObjetSpvFromObjetTimos(site); if (spvSite != null) { m_nIdSiteSpv = spvSite.Id; m_dicSitesSpvConcernant[spvSite.Id] = true; } }
public override object Invoke(object objetAppelle, params object[] parametres) { CSite site = objetAppelle as CSite; if (site == null) return null; DateTime? dtLimite = null; if (parametres.Length == 1 && parametres[0] is DateTime) { dtLimite = (DateTime?)parametres[0]; } return CMethodeSupplementaireSelectLastSiteDataAt.GetDataAt(site, dtLimite, true); }
// GET: Site/Create public ActionResult Create() { if (Session["employee"] == null) { return(RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url })); } else { o_site = new CSite(); return(View(o_site)); } }
public override object Invoke(object objetAppelle, params object[] parametres) { CSite site = objetAppelle as CSite; if (site == null) { return(null); } CFiltreData filtreDatas = new CFiltreData( CCamusatQowisioData.c_champFuPickup_Id + " = @1 OR " + CCamusatQowisioData.c_champFuSite_Id + " = @1", site.Id); if (parametres.Length > 0) { try { if (parametres[0] != null) { DateTime?dateDebut = (DateTime?)parametres[0]; filtreDatas = CFiltreData.GetAndFiltre(filtreDatas, new CFiltreData(CCamusatQowisioData.c_champQwDateTime + " >= @1", dateDebut.Value)); } } catch (Exception e) { } } if (parametres.Length > 1) { try { if (parametres[1] != null) { DateTime?dateFin = (DateTime?)parametres[1]; filtreDatas = CFiltreData.GetAndFiltre(filtreDatas, new CFiltreData(CCamusatQowisioData.c_champQwDateTime + " < @1", dateFin.Value)); } } catch (Exception e) { } } CListeObjetDonneeGenerique <CCamusatQowisioData> listeDatas = new CListeObjetDonneeGenerique <CCamusatQowisioData>( site.ContexteDonnee, filtreDatas); return(listeDatas.ToArray()); }