Example #1
0
        private void SetUnpackedValueOfListStaticItem(MsgPack.Serialization.PolymorphicMemberTypeRuntimeType_List_ListStaticItemGetOnlyCollectionProperty unpackingContext, System.Collections.Generic.IList <string> unpackedValue)
        {
            System.Collections.Generic.IList <string> existent = default(System.Collections.Generic.IList <string>);
            existent = unpackingContext.ListStaticItem;
            System.Collections.Generic.IEnumerator <string> enumerator = unpackedValue.GetEnumerator();
            string current;

            try {
                for (
                    ; enumerator.MoveNext();
                    )
                {
                    current = enumerator.Current;
                    existent.Add(current);
                }
            }
            finally {
                enumerator.Dispose();
            }
        }
Example #2
0
        private void SetUnpackedValueOfListObjectItem(MsgPack.Serialization.PolymorphicMemberTypeRuntimeType_List_ListObjectItemReadOnlyCollectionField unpackingContext, System.Collections.Generic.IList <object> unpackedValue)
        {
            System.Collections.Generic.IList <object> existent = default(System.Collections.Generic.IList <object>);
            existent = unpackingContext.ListObjectItem;
            System.Collections.Generic.IEnumerator <object> enumerator = unpackedValue.GetEnumerator();
            object current;

            try {
                for (
                    ; enumerator.MoveNext();
                    )
                {
                    current = enumerator.Current;
                    existent.Add(current);
                }
            }
            finally {
                enumerator.Dispose();
            }
        }
Example #3
0
 protected internal override MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListPolymorphicItemGetOnlyCollectionProperty UnpackFromCore(MsgPack.Unpacker unpacker)
 {
     MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListPolymorphicItemGetOnlyCollectionProperty result = default(MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListPolymorphicItemGetOnlyCollectionProperty);
     result = new MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListPolymorphicItemGetOnlyCollectionProperty();
     if (unpacker.IsArrayHeader)
     {
         int unpacked   = default(int);
         int itemsCount = default(int);
         itemsCount = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker);
         System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry> nullable = default(System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry>);
         if ((unpacked < itemsCount))
         {
             if ((unpacker.Read() == false))
             {
                 throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(0);
             }
             if (((unpacker.IsArrayHeader == false) &&
                  (unpacker.IsMapHeader == false)))
             {
                 nullable = this._serializer0.UnpackFrom(unpacker);
             }
             else
             {
                 MsgPack.Unpacker disposable = default(MsgPack.Unpacker);
                 disposable = unpacker.ReadSubtree();
                 try {
                     nullable = this._serializer0.UnpackFrom(disposable);
                 }
                 finally {
                     if (((disposable == null)
                          == false))
                     {
                         disposable.Dispose();
                     }
                 }
             }
         }
         if (((nullable == null)
              == false))
         {
             System.Collections.Generic.IEnumerator <MsgPack.Serialization.FileSystemEntry> enumerator = nullable.GetEnumerator();
             MsgPack.Serialization.FileSystemEntry current;
             try {
                 for (
                     ; enumerator.MoveNext();
                     )
                 {
                     current = enumerator.Current;
                     result.ListPolymorphicItem.Add(current);
                 }
             }
             finally {
                 enumerator.Dispose();
             }
         }
         unpacked = (unpacked + 1);
     }
     else
     {
         int itemsCount0 = default(int);
         itemsCount0 = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker);
         for (int i = 0; (i < itemsCount0); i = (i + 1))
         {
             string key       = default(string);
             string nullable0 = default(string);
             nullable0 = MsgPack.Serialization.UnpackHelpers.UnpackStringValue(unpacker, typeof(MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListPolymorphicItemGetOnlyCollectionProperty), "MemberName");
             if (((nullable0 == null)
                  == false))
             {
                 key = nullable0;
             }
             else
             {
                 throw MsgPack.Serialization.SerializationExceptions.NewNullIsProhibited("MemberName");
             }
             if ((key == "ListPolymorphicItem"))
             {
                 System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry> nullable1 = default(System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry>);
                 if ((unpacker.Read() == false))
                 {
                     throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i);
                 }
                 if (((unpacker.IsArrayHeader == false) &&
                      (unpacker.IsMapHeader == false)))
                 {
                     nullable1 = this._serializer0.UnpackFrom(unpacker);
                 }
                 else
                 {
                     MsgPack.Unpacker disposable0 = default(MsgPack.Unpacker);
                     disposable0 = unpacker.ReadSubtree();
                     try {
                         nullable1 = this._serializer0.UnpackFrom(disposable0);
                     }
                     finally {
                         if (((disposable0 == null)
                              == false))
                         {
                             disposable0.Dispose();
                         }
                     }
                 }
                 if (((nullable1 == null)
                      == false))
                 {
                     System.Collections.Generic.IEnumerator <MsgPack.Serialization.FileSystemEntry> enumerator0 = nullable1.GetEnumerator();
                     MsgPack.Serialization.FileSystemEntry current0;
                     try {
                         for (
                             ; enumerator0.MoveNext();
                             )
                         {
                             current0 = enumerator0.Current;
                             result.ListPolymorphicItem.Add(current0);
                         }
                     }
                     finally {
                         enumerator0.Dispose();
                     }
                 }
             }
             else
             {
                 unpacker.Skip();
             }
         }
     }
     return(result);
 }
Example #4
0
        private void replyAction(string FromUserId, string eventType, string textContent, string ActionParam)
        {
            Articles articles = new Articles
            {
                toUserId = FromUserId,
                msgType  = "text",
                text     = new MessageText
                {
                    content = "系统未找到相关信息!"
                }
            };

            if (eventType != "")
            {
                if ("follow".Equals(eventType))
                {
                    if (!string.IsNullOrEmpty(FromUserId))
                    {
                        MemberProcessor.AddFuwuFollowUser(FromUserId);
                    }
                    string aliOHFollowRelayTitle = this.siteSettings.AliOHFollowRelayTitle;
                    Hidistro.Entities.VShop.ReplyInfo subscribeReply = AliFuwuReplyHelper.GetSubscribeReply();
                    if (subscribeReply != null)
                    {
                        if (subscribeReply.MessageType == MessageType.Text)
                        {
                            TextReplyInfo textReplyInfo = subscribeReply as TextReplyInfo;
                            articles.text.content = textReplyInfo.Text;
                        }
                        else if (subscribeReply.ArticleID > 0)
                        {
                            ArticleInfo articleInfo = ArticleHelper.GetArticleInfo(subscribeReply.ArticleID);
                            if (articleInfo != null)
                            {
                                articles = this.GetAlipayArticlesFromArticleInfo(articleInfo, Globals.HostPath(System.Web.HttpContext.Current.Request.Url), FromUserId);
                            }
                            else
                            {
                                articles.text.content = aliOHFollowRelayTitle;
                            }
                        }
                    }
                    else
                    {
                        articles.text.content = aliOHFollowRelayTitle;
                    }
                }
                else if ("unfollow".Equals(eventType))
                {
                    if (!string.IsNullOrEmpty(FromUserId))
                    {
                        MemberProcessor.DelFuwuFollowUser(FromUserId);
                    }
                }
                else if ("click".Equals(eventType))
                {
                    int num = 0;
                    if (ActionParam != "" && int.TryParse(ActionParam, out num) && num > 0)
                    {
                        Hidistro.Entities.VShop.MenuInfo fuwuMenu = VShopHelper.GetFuwuMenu(num);
                        if (fuwuMenu != null)
                        {
                            Hidistro.Entities.VShop.ReplyInfo reply = AliFuwuReplyHelper.GetReply(fuwuMenu.ReplyId);
                            if (reply != null)
                            {
                                ArticleInfo articleInfo2 = ArticleHelper.GetArticleInfo(reply.ArticleID);
                                if (articleInfo2 != null)
                                {
                                    articles = this.GetAlipayArticlesFromArticleInfo(articleInfo2, Globals.HostPath(System.Web.HttpContext.Current.Request.Url), FromUserId);
                                }
                            }
                        }
                    }
                }
                else if ("enter".Equals(eventType))
                {
                    if (!string.IsNullOrEmpty(this.UserInfo))
                    {
                        MemberInfo openIdMember = MemberProcessor.GetOpenIdMember(FromUserId, "fuwu");
                        if (openIdMember != null && openIdMember.AlipayLoginId.StartsWith("FW*"))
                        {
                            JObject jObject       = JsonConvert.DeserializeObject(this.UserInfo) as JObject;
                            string  alipayLoginId = "";
                            string  text          = "";
                            if (jObject["logon_id"] != null)
                            {
                                alipayLoginId = jObject["logon_id"].ToString();
                            }
                            if (jObject["user_name"] != null)
                            {
                                text = jObject["user_name"].ToString();
                            }
                            if (text != "" && text != "")
                            {
                                openIdMember.AlipayLoginId  = alipayLoginId;
                                openIdMember.AlipayUsername = text;
                                MemberProcessor.SetAlipayInfos(openIdMember);
                            }
                        }
                    }
                    if (!ActionParam.Contains("sceneId"))
                    {
                        return;
                    }
                    JObject jObject2 = JsonConvert.DeserializeObject(ActionParam) as JObject;
                    if (jObject2["scene"]["sceneId"] != null)
                    {
                        string text2 = jObject2["scene"]["sceneId"].ToString();
                        if (text2.StartsWith("bind"))
                        {
                            if (AlipayFuwuConfig.BindAdmin.Count > 10)
                            {
                                AlipayFuwuConfig.BindAdmin.Clear();
                            }
                            if (AlipayFuwuConfig.BindAdmin.ContainsKey(text2))
                            {
                                AlipayFuwuConfig.BindAdmin[text2] = FromUserId;
                            }
                            else
                            {
                                AlipayFuwuConfig.BindAdmin.Add(text2, FromUserId);
                            }
                            articles.text.content = "您正在尝试绑定服务窗管理员身份!";
                        }
                    }
                }
            }
            else if (textContent != "")
            {
                articles = null;
                System.Collections.Generic.IList <Hidistro.Entities.VShop.ReplyInfo> replies = AliFuwuReplyHelper.GetReplies(ReplyType.Keys);
                if (replies != null && replies.Count > 0)
                {
                    foreach (Hidistro.Entities.VShop.ReplyInfo current in replies)
                    {
                        if (current != null)
                        {
                            if (current.MatchType == MatchType.Equal && current.Keys == textContent)
                            {
                                if (current.MessageType == MessageType.Text)
                                {
                                    articles = new Articles
                                    {
                                        toUserId = FromUserId,
                                        msgType  = "text",
                                        text     = new MessageText
                                        {
                                            content = ""
                                        }
                                    };
                                    TextReplyInfo textReplyInfo2 = current as TextReplyInfo;
                                    articles.text.content = textReplyInfo2.Text;
                                    break;
                                }
                                if (current.ArticleID > 0)
                                {
                                    ArticleInfo articleInfo3 = ArticleHelper.GetArticleInfo(current.ArticleID);
                                    if (articleInfo3 != null)
                                    {
                                        articles = this.GetAlipayArticlesFromArticleInfo(articleInfo3, Globals.HostPath(System.Web.HttpContext.Current.Request.Url), FromUserId);
                                        if (articles != null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                            if (current.MatchType == MatchType.Like && current.Keys.Contains(textContent))
                            {
                                if (current.MessageType == MessageType.Text)
                                {
                                    articles = new Articles
                                    {
                                        toUserId = FromUserId,
                                        msgType  = "text",
                                        text     = new MessageText
                                        {
                                            content = ""
                                        }
                                    };
                                    TextReplyInfo textReplyInfo3 = current as TextReplyInfo;
                                    articles.text.content = textReplyInfo3.Text;
                                    break;
                                }
                                if (current.ArticleID > 0)
                                {
                                    ArticleInfo articleInfo4 = ArticleHelper.GetArticleInfo(current.ArticleID);
                                    if (articleInfo4 != null)
                                    {
                                        articles = this.GetAlipayArticlesFromArticleInfo(articleInfo4, Globals.HostPath(System.Web.HttpContext.Current.Request.Url), FromUserId);
                                        if (articles != null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (articles == null)
            {
                System.Collections.Generic.IList <Hidistro.Entities.VShop.ReplyInfo> replies2 = AliFuwuReplyHelper.GetReplies(ReplyType.NoMatch);
                if (replies2 != null && replies2.Count > 0)
                {
                    using (System.Collections.Generic.IEnumerator <Hidistro.Entities.VShop.ReplyInfo> enumerator2 = replies2.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            Hidistro.Entities.VShop.ReplyInfo current2 = enumerator2.Current;
                            if (current2.MessageType == MessageType.Text)
                            {
                                articles = new Articles
                                {
                                    toUserId = FromUserId,
                                    msgType  = "text",
                                    text     = new MessageText
                                    {
                                        content = ""
                                    }
                                };
                                TextReplyInfo textReplyInfo4 = current2 as TextReplyInfo;
                                articles.text.content = textReplyInfo4.Text;
                                break;
                            }
                            if (current2.ArticleID > 0)
                            {
                                ArticleInfo articleInfo5 = ArticleHelper.GetArticleInfo(current2.ArticleID);
                                if (articleInfo5 != null)
                                {
                                    articles = this.GetAlipayArticlesFromArticleInfo(articleInfo5, Globals.HostPath(System.Web.HttpContext.Current.Request.Url), FromUserId);
                                    if (articles != null)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                        goto IL_674;
                    }
                }
                articles = new Articles
                {
                    toUserId = FromUserId,
                    msgType  = "text",
                    text     = new MessageText
                    {
                        content = "系统未找到相关信息!"
                    }
                };
            }
IL_674:
            AliOHHelper.log(AliOHHelper.CustomSend(articles).Body);
        }
Example #5
0
 private void SetUnpackedValueOfListPolymorphicItem(MsgPack.Serialization.PolymorphicMemberTypeRuntimeType_List_ListPolymorphicItemPrivateSetterCollectionProperty unpackingContext, System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry> unpackedValue)
 {
     System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry> existent = default(System.Collections.Generic.IList <MsgPack.Serialization.FileSystemEntry>);
     existent = unpackingContext.ListPolymorphicItem;
     if ((existent == null))
     {
         this._methodBasePolymorphicMemberTypeRuntimeType_List_ListPolymorphicItemPrivateSetterCollectionProperty_set_ListPolymorphicItem0.Invoke(unpackingContext, new object[] {
             unpackedValue
         });
     }
     else
     {
         System.Collections.Generic.IEnumerator <MsgPack.Serialization.FileSystemEntry> enumerator = unpackedValue.GetEnumerator();
         MsgPack.Serialization.FileSystemEntry current;
         try {
             for (
                 ; enumerator.MoveNext();
                 )
             {
                 current = enumerator.Current;
                 existent.Add(current);
             }
         }
         finally {
             enumerator.Dispose();
         }
     }
 }
Example #6
0
 public Iterator <T> iterator()
 {
     return(ToJava.EnumeratorToIterator(_stack.GetEnumerator()));
 }
Example #7
0
 protected string GetMemberCustomGroup()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     System.Collections.Generic.IList <CustomGroupingInfo> customGroupingList = CustomGroupingHelper.GetCustomGroupingList();
     if (customGroupingList != null && customGroupingList.Count > 0)
     {
         using (System.Collections.Generic.IEnumerator <CustomGroupingInfo> enumerator = customGroupingList.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 CustomGroupingInfo current = enumerator.Current;
                 stringBuilder.Append(" <label class=\"middle mr20\">");
                 stringBuilder.AppendFormat("<input type=\"checkbox\" class=\"CustomGroup\" value=\"{0}\">{1}", current.Id, current.GroupName);
                 stringBuilder.Append("  </label>");
             }
             goto IL_7D;
         }
     }
     stringBuilder.Append("暂无分组信息,去<a href='../member/CustomDistributorList.aspx'>创建新分组</a>");
     IL_7D:
     return(stringBuilder.ToString());
 }
Example #8
0
    public string procede()
    {

        //la chaine retournée
        String retour = "";

        //la connection a la bdd

        Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        c.Open();



        //pour tous les membres
        System.Collections.Generic.IList<Membre> members = MembreDAO.getAllMembers();
        System.Collections.Generic.IEnumerator<Membre> i = members.GetEnumerator();
        while (i.MoveNext())
        {

            //les bien interessants pour le client
            System.Collections.Generic.List<System.Data.DataRow> drClient = new System.Collections.Generic.List<DataRow>();

            //pour toutes les alertes emails
            System.Collections.Generic.IList<RequeteBien> listeMembres = MembreDAO.getAlerteMembre(i.Current);
            System.Collections.Generic.IEnumerator<RequeteBien> l = listeMembres.GetEnumerator();
            while (l.MoveNext())
            {

                try
                {

                    System.Data.DataSet ds = null;
                    ds = c.exeRequette(l.Current.REQUETE_SQL);

                    //pour tous les biens correspondant a l'alerte mail ... et qui on été soient modifiés soient ajoutés :
                    System.Collections.IEnumerator dr = ds.Tables[0].Rows.GetEnumerator();
                    while (dr.MoveNext())
                    {
                        //si le bien a été mis a jour récement
                        if (((bool)(((System.Data.DataRow)dr.Current)["maj"])))
                        {
                            drClient.Add((System.Data.DataRow)dr.Current);
                        }
                    }// fin biens
                }
                catch (Exception ee) { retour += "\n erreur dans la recherche des biens interessants pour le client : " + ee.Message + "\n"; }

            }//fin alerte mail



            //on envoie que si il y a des nouveaux biens interessants pour l'utilisateur : 
            if (drClient.Count != 0)
            {

                retour += " \nmail envoyé à : " + i.Current.ID_CLIENT;

                #region envoie du mail


                SmtpClient smtp = new SmtpClient();
                MailMessage message = new MailMessage();
                String date = DateTime.Now.ToString();


                try
                {
                    Connexion c1 = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                    c1.Open();
                    System.Data.DataSet ds = c.exeRequette("Select * from Environnement");
                    c1.Close();

                    String Host_smtp = (String)ds.Tables[0].Rows[0]["HostSMTP"];
                    String Port_smtp = (String)ds.Tables[0].Rows[0]["Port_smtp"];

                    //IP adresse du serveur SMTP
                    smtp.Host = Host_smtp;

                    // port par defaut pour le protocol SMTP
                    smtp.Port = int.Parse(Port_smtp);

                    //l'adresse de l'expéditeur est transmise a l'objet MailAddress
                    message.From = new MailAddress("*****@*****.**");

                    // adresse une collection 
                    message.Subject = "Patrimo : un bien vous interesse";

                    message.To.Add(i.Current.ID_CLIENT);

                    message.IsBodyHtml = true;

                    message.Body = "";

                    //on met tous les biens intressants dans le corp du message
                    System.Collections.Generic.IEnumerator<System.Data.DataRow> iDr = drClient.GetEnumerator();

                    message.Body += "<body><table border=\"0\" width=\"600\" cellspacing=\"0\" cellpadding=\"0\">"
                                    + "<tr><td width=\"100%\">"
                                    + "<img src=\"http://www.patrimo.fr/img_site/logo_patrimonium.jpg\" /><font size=\"4\"><b>PATRIMO - Agence immobili&egrave;re</b></font></td></tr>"
                                    + "<tr><td width=\"100%\">";
                    while (iDr.MoveNext())
                        message.Body += afficheBien((String)(iDr.Current)["ref"]);

                    message.Body += "</td></tr>"
                                    + "<tr><td width=\"100%\">"
                                    + "<p align=\"center\">Agence Patrimo | <a href=\"http://www.patrimo.fr/\" target=\"_blank\">www.patrimo.fr</a> | 01.46.49.82.60 | 25 rue Gabriel Peri - 92700 Colombes</p>"
                                    + "</td></tr></table></body>";


                    // envoie au serveur SMTP
                    smtp.Send(message);


                    String requete = "INSERT INTO Messages (email_contact,message,ip_address,date_mail) VALUES ( '" + message.From.ToString() + "','" + message.Body.ToString() + "','???','" + date + "')";

                    c.exeRequette(requete);


                }
                catch (Exception ex)
                {
                    retour += "\n erreur dans la creation et l'envoi du mail : " + ex.Message + "\n source : " + ex.StackTrace + "  \n";
                }

                #endregion

            }


        }//fin du menbre



        try
        {
            //enfin, on spécifie que les maj on été éffectués dans la table bien : 
            c.exeRequette("UPDATE Biens SET Biens.maj = True");
        }
        catch (Exception e) { retour += " \nerreur dans la mise a jour de la table bien " + e.Message + "\n"; }

        if (c != null)
            c.Close();

        return "Resultats du " + DateTime.Now + "  :  \n" + retour;
    }
 public virtual System.Collections.Generic.IEnumerator <ENTITY> GetEnumerator()
 {
     return(_selectedList.GetEnumerator());
 }