当前位置: 首页>>代码示例>>C#>>正文


C# BO类代码示例

本文整理汇总了C#中BO的典型用法代码示例。如果您正苦于以下问题:C# BO类的具体用法?C# BO怎么用?C# BO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BO类属于命名空间,在下文中一共展示了BO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateUploadMessages

        public void CreateUploadMessages(BO.ORCID.Person person, string loggedInInternalUsername)
        {
            // Before opening the transaction get the 'read limited' token if it exists.
            // if it does not exist or is expired we will create a message to update it.
            BO.ORCID.PersonToken personToken = new BLL.ORCID.PersonToken().GetByPersonIDAndPermissionID(person.PersonID, (int)BO.ORCID.REFPermission.REFPermissions.orcid_profile_read_limited);

            using (System.Data.Common.DbTransaction trans = base.GetEditTransaction())
            {
                try
                {
                    new ProfilesRNSDLL.BLL.ORCID.Person().Edit(person, trans);
                    if (!personToken.Exists || personToken.IsExpired)
                    {
                        CreateMessageToReadLimited(person, trans);
                    }
                    if (person.PushBiographyToORCID || (person.HasURLsToPush))
                    {
                        CreateBioUpdateMessage(person, trans, loggedInInternalUsername);
                    }
                    WorksUpdate(person, trans);
                    AffiliationsUpdate(person, trans);
                    trans.Commit();
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    throw ErrorLog.LogError(ex, loggedInInternalUsername, "An error occurred while generating the messages to send to ORCID.");
                }
            }
        }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:30,代码来源:PersonMessage.cs

示例2: UpdateUserToken

 public void UpdateUserToken(Dictionary<string, object> items, BO.ORCID.Person person, string loggedInInternalUsername)
 {
     try
     {
         BO.ORCID.PersonToken accessToken = PersonToken.GetAPIUserAccessToken(items, person);
         if (!Save(accessToken))
         {
             throw new Exception("An unexpected error occurred while saving the token");
         }
         if (accessToken.PermissionID == (int)BO.ORCID.REFPermission.REFPermissions.orcid_profile_read_limited)
         {
             BLL.ORCID.PersonMessage personMessageBLL = new PersonMessage();
             List<BO.ORCID.PersonMessage> personMessages = personMessageBLL.GetByPersonIDAndRecordStatusIDAndPermissionID(person.PersonID,
                 (int)BO.ORCID.REFRecordStatus.REFRecordStatuss.Waiting_for_ORCID_User_for_approval,
                 (int)accessToken.PermissionID, false);
             foreach (BO.ORCID.PersonMessage personMessage in personMessages)
             {
                 personMessage.RecordStatusID = (int)BO.ORCID.REFRecordStatus.REFRecordStatuss.Success;
                 if (!personMessageBLL.Save(personMessage))
                 {
                     throw new Exception("Token was saved but an unexpected error occurred while updating the related messages.");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw BLL.ORCID.ErrorLog.LogError(ex, loggedInInternalUsername, "Error saving token information to table: ProfileToken in databae: BUMC_ORCID.");
     }
 }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:30,代码来源:PersonToken.cs

示例3: Participer

        /// <summary>
        /// Enregistre la participation d'un élève d'ybe section à une UF.
        /// </summary>
        /// <param name="section">Section de l'élève</param>
        /// <param name="eleve">Elève dont on enregistre la participation à une UF</param>
        /// <param name="uf">UF à laquelle l'élève participe</param>
        /// <param name="cote">Cote de l'élève</param>
        /// <param name="date">Date de l'examen</param>
        public static void Participer(BO.Section section, BO.Eleve eleve, BO.UF uf, int cote, DateTime date)
        {
            List<BO.UF> participations = DAL.AccesUF.ChargerParticipations(eleve, section);
            // soit l'uf a déjà été tentée, dans ce cas on update la participation
            // soit l'uf n'a jamais été tentée, dans ce cas on insère une nouvelle participation
            bool existe = false;
            foreach (BO.UF participation in participations)
            {
                if (participation.Id == uf.Id)
                {
                    existe = true;
                    break;
                }
            }

            if (existe)
            {
                // update
                DAL.AccesUF.MajParticipation(section, eleve, uf, cote, date);
            }
            else
            {
                // insert
                DAL.AccesUF.InsererParticipation(section, eleve, uf, cote, date);
            }
        }
开发者ID:ColinDuquesnoy,项目名称:ProjUF32,代码行数:34,代码来源:GestionUF.cs

示例4: ChargerUFPossibles

 /// <summary>
 /// Charge la liste des UF possibles d'un élève d'une section.
 /// </summary>
 /// <param name="section">Section à laquelle l'élève appartient</param>
 /// <param name="eleve">Elève dont on veut récupérer la liste des UF possibles</param>
 /// <returns>Liste des UF possibles</returns>
 public static List<BO.UF> ChargerUFPossibles(BO.Section section, BO.Eleve eleve)
 {
     List<BO.UF> retVal = new List<BO.UF>();
     List<BO.UF> ufRéussies = DAL.AccesUF.ChargerUFRéussies(eleve, section);
     List<BO.UF> ufCandidates = chargerUFNonRéussies(section, eleve, ufRéussies);
     List<BO.Groupe> groupes = DAL.AccesGroupe.ChargerGroupes();
     List<BO.Prérequis> prérequis = DAL.AccesRequerir.ChargerPrérequis();
     // On filtre les UF selon leur prérequis
     foreach (BO.UF uf in ufCandidates)
     {
         int cptGroupes = 0;
         int cptGroupesOK = 0;
         foreach (BO.Groupe groupe in groupes)
         {
             if (groupe.IdUF == uf.Id)
             {
                 cptGroupes += 1;
                 if (vérifierGroupe(groupe, prérequis, ufRéussies))
                     cptGroupesOK += 1;
             }
         }
         // Il faut au moin avoir réussis un groupe de prérequis (s'il y en a)
         if(cptGroupes == 0 || cptGroupesOK >= 1)
             retVal.Add(uf);
     }
     return retVal;
 }
开发者ID:ColinDuquesnoy,项目名称:ProjUF32,代码行数:33,代码来源:GestionUF.cs

示例5: GetPersonAffiliationID

 private void GetPersonAffiliationID(BO.ORCID.PersonAffiliation personAffiliation)
 {
     BO.ORCID.PersonAffiliation personAffiliationExisting = base.GetByProfilesIDAndAffiliationTypeID(personAffiliation.ProfilesID, personAffiliation.AffiliationTypeID);
     if (personAffiliationExisting.Exists)
     {
         personAffiliation.PersonAffiliationID = personAffiliationExisting.PersonAffiliationID;
     }
 }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:8,代码来源:PersonAffiliation.cs

示例6: DlgParticiper

 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="uf">UF concernée</param>
 public DlgParticiper(BO.UF uf)
 {
     InitializeComponent();
     this.Text = uf.Libellé;
     this.coteMax = uf.NbHeures * 10;
     this.lblRésultats.Text = "Résultats ( /" + this.coteMax.ToString() + ")";
     this.btOk.Enabled = false;
 }
开发者ID:ColinDuquesnoy,项目名称:ProjUF32,代码行数:12,代码来源:DlgParticiper.cs

示例7: Update

 public override void Update(BO.BOBase us)
 {
     BO.User u = us as BO.User;
     int error = 0;
     List<SqlParameter> userparam = fillParams(u);
     userparam.Add(DAL.CommonMethods.parameter("w_UserID", u.ID));
     DAL.CommonMethods.UpdateDataTable("usp_update_AggregateUser", out error, userparam.ToArray());
 }
开发者ID:Mr0Cake,项目名称:Aggregate,代码行数:8,代码来源:UserBLL.cs

示例8: Create

 public override void Create(BO.BOBase us)
 {
     BO.User u = us as BO.User;
     int error = 0;
     int identity = 0;
     DAL.CommonMethods.UpdateDataTable("usp_insert_AggregateUser",out error, out identity, fillParams(u).ToArray());
     u.ID = identity;
 }
开发者ID:Mr0Cake,项目名称:Aggregate,代码行数:8,代码来源:UserBLL.cs

示例9: SendORCIDXMLMessage

        public void SendORCIDXMLMessage(BO.ORCID.Person person, string accessToken, BO.ORCID.PersonMessage personMessage, BO.ORCID.REFPermission refPermission)
        {
            List<string> responseMessage = new List<string>();
            BLL.ORCID.PersonMessage personMessageBLL = new PersonMessage();
            personMessage.RequestURL = ProfilesRNSDLL.BO.ORCID.Config.ORCID_API_URL_WITH_VERSION + "/" + person.ORCID + "/" + refPermission.MethodAndRequest;
            InitializePersonMessageRequestInfo(personMessage, personMessageBLL);

            string method = System.Net.WebRequestMethods.Http.Post.ToString();
            if (personMessage.PermissionID == (int)BO.ORCID.REFPermission.REFPermissions.orcid_bio_update)
            {
                method = System.Net.WebRequestMethods.Http.Put.ToString();
            }

            string msg = string.Empty;

            WebRequest httpWebRequest = WebRequest.Create(personMessage.RequestURL);
            httpWebRequest.ContentType = "application/orcid+xml";
            httpWebRequest.Method = method;

            NameValueCollection param2 = new NameValueCollection();
            string AuthBearer = "Authorization: Bearer " + accessToken;
            responseMessage.Add(AuthBearer);

            param2.Add("Authorization", " Bearer " + accessToken);

            foreach (var key in param2.AllKeys)
            {
                httpWebRequest.Headers.Add(key, param2[key]);
            }

            string profile = personMessage.XML_Sent;

            byte[] xmlBytes = Encoding.UTF8.GetBytes(profile);
            using (var requestStream = httpWebRequest.GetRequestStream())
            {
                requestStream.Write(xmlBytes, 0, xmlBytes.Length);
                requestStream.Close();
            }
            try
            {
                using (WebResponse response = httpWebRequest.GetResponse())
                {
                    HttpWebResponse httpResponse = (HttpWebResponse)response;
                    using (Stream data = response.GetResponseStream())
                    {
                        string text = new StreamReader(data).ReadToEnd();
                        personMessage.HttpResponseCode = httpResponse.StatusCode.ToString();
                        responseMessage.Add(text);
                        personMessage.MessagePostSuccess = true;
                    }
                }
            }
            catch (WebException en)
            {
                ProcessWebException(personMessage, en, httpWebRequest);
            }
            SavePersonMessage(personMessage, refPermission, personMessageBLL);
        }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:58,代码来源:ORCID.cs

示例10: ReadORCIDProfile

 public void ReadORCIDProfile(BO.ORCID.Person person, BO.ORCID.PersonMessage personMessage, BO.ORCID.REFPermission refPermission, string loggedInInternalUsername)
 {
     personMessage.RequestURL = ProfilesRNSDLL.BO.ORCID.Config.ORCID_API_URL_WITH_VERSION + "/" + person.ORCID + "/" + refPermission.MethodAndRequest;
     NameValueCollection param2 = new NameValueCollection();
     string token = BLL.ORCID.OAuth.GetClientToken(refPermission.PermissionScope, loggedInInternalUsername);
     param2.Add("Authorization", " Bearer " + token);
     param2.Add("Scope", refPermission.PermissionScope);
     GetWebResponseMethodGet(personMessage, refPermission, param2);
 }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:9,代码来源:ORCID.cs

示例11: SetPersonMessageID

 internal static void SetPersonMessageID(BO.ORCID.Person person)
 {
     if (person.URLs != null && person.URLs.Count > 0)
     {
         foreach (BO.ORCID.PersonURL personURL in person.URLs)
         {
             personURL.PersonMessageID = person.PersonMessage.PersonMessageID;
         }
     }
 }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:10,代码来源:PersonURL.cs

示例12: Create

 public BO.ORCID.PersonMessage Create(BO.ORCID.Person person, BO.ORCID.REFPermission refPermission)
 {
     ProfilesRNSDLL.BO.ORCID.PersonMessage personMessage = new ProfilesRNSDLL.BO.ORCID.PersonMessage();
     personMessage.PermissionID = refPermission.PermissionID;
     personMessage.RecordStatusID = (int)ProfilesRNSDLL.BO.ORCID.REFRecordStatus.REFRecordStatuss.Waiting_for_ORCID_User_for_approval;
     personMessage.PersonID = person.PersonID;
     personMessage.RequestURL = ProfilesRNSDLL.BO.ORCID.Config.ORCID_API_URL_WITH_VERSION + "/" + person.ORCID + "/" + refPermission.MethodAndRequest;
     new BLL.ORCID.PersonMessage().Save(personMessage);
     return personMessage;
 }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:10,代码来源:PersonMessage.cs

示例13: SetPersonMessageID

 internal static void SetPersonMessageID(BO.ORCID.Person person)
 {
     if (person.Affiliations != null && person.Affiliations.Count > 0)
     {
         foreach (BO.ORCID.PersonAffiliation personAffiliation in person.Affiliations)
         {
             personAffiliation.PersonMessageID = person.PersonMessage.PersonMessageID;
         }
     }
 }
开发者ID:nicholaswilliambrown,项目名称:ProfilesRNS_ORCID,代码行数:10,代码来源:PersonAffiliation.cs

示例14: SetPersonMessageID

 internal static void SetPersonMessageID(BO.ORCID.Person person)
 {
     if (person.Othernames != null && person.Othernames.Count > 0)
     {
         foreach (BO.ORCID.PersonOthername personOthername in person.Othernames)
         {
             personOthername.PersonMessageID = person.PersonMessage.PersonMessageID;
         }
     }
 }
开发者ID:TariqStuff,项目名称:ProfilesRNS,代码行数:10,代码来源:PersonOthername.cs

示例15: SetPersonMessageID

 internal static void SetPersonMessageID(BO.ORCID.Person person)
 {
     if (person.AlternateEmails != null && person.AlternateEmails.Count > 0)
     {
         foreach (BO.ORCID.PersonAlternateEmail personAlternateEmail in person.AlternateEmails)
         {
             personAlternateEmail.PersonMessageID = person.PersonMessage.PersonMessageID;
         }
     }
 }
开发者ID:TariqStuff,项目名称:ProfilesRNS,代码行数:10,代码来源:PersonAlternateEmail.cs


注:本文中的BO类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。