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


C# CY.Save方法代码示例

本文整理汇总了C#中CY.Save方法的典型用法代码示例。如果您正苦于以下问题:C# CY.Save方法的具体用法?C# CY.Save怎么用?C# CY.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CY的用法示例。


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

示例1: SaveStimulition

        protected void SaveStimulition(CY.CSTS.Core.Business.StimulationCheck stimulition, int statetype)
        {
            IList<CY.CSTS.Core.Business.StimulationType> stimulationlist = new List<CY.CSTS.Core.Business.StimulationType>();
            StringBuilder res = new StringBuilder();

            for (int i = 0; i < this.CheckBoxContent.Items.Count; i++)
            {
                if (CheckBoxContent.Items[i].Selected)
                {
                    res.Append(CheckBoxContent.Items[i].Value + ",");
                    if (CheckBoxContent.Items[i].Value == "分中心与协作单位")
                    {
                        CY.CSTS.Core.Business.StimulationType unit = new CY.CSTS.Core.Business.StimulationType();
                        unit.DateCreated = DateTime.Now;
                        unit.Des = TxtUnit1.Text;
                        unit.StimulatedType = 3;
                        unit.State = statetype;
                        stimulationlist.Add(unit);

                    }
                    if (CheckBoxContent.Items[i].Value == "中心")
                    {
                        CY.CSTS.Core.Business.StimulationType center = new CY.CSTS.Core.Business.StimulationType();
                        center.DateCreated = DateTime.Now;
                        center.Des = TxtCenter1.Text;
                        center.StimulatedType = 2;
                        center.State = statetype;
                        stimulationlist.Add(center);

                    }
                    if (CheckBoxContent.Items[i].Value == "机组")
                    {
                        CY.CSTS.Core.Business.StimulationType crew = new CY.CSTS.Core.Business.StimulationType();
                        crew.DateCreated = DateTime.Now;
                        crew.Des = TxtCrew1.Text;
                        crew.StimulatedType = 1;
                        crew.State = statetype;
                        stimulationlist.Add(crew);
                    }

                }

            }
            if (res.Length > 1)
            {
                res.Remove(res.Length - 1, 1);
            }
            stimulition.Content = res.ToString();
            stimulition.Name = Txtname.Text;
            stimulition.StartDate = Convert.ToDateTime(TxtUnload.Text);
            stimulition.EndDate = Convert.ToDateTime(TxtJudge.Text);
            stimulition.AddData = DateTime.Now;
            //stimulition.AddPerson = Session[User];
            //stimulition.DateCreated=Convert.ToDateTime(TxtFirst.Text);
            stimulition.Save();
            for (int i = 0; i < stimulationlist.Count; i++)
            {
                stimulationlist.ElementAt(i).StimulationId = stimulition.Id;
                stimulationlist.ElementAt(i).Save();
            }
            bindDatas();
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:62,代码来源:StimulitionManagement.aspx.cs

示例2: Updatestimulition

        protected void Updatestimulition(CY.CSTS.Core.Business.StimulationCheck stimulition, int statetype)
        {
            IList<CY.CSTS.Core.Business.StimulationType> stimulationlist = CY.CSTS.Core.Business.StimulationType.SelectStimulationTypesByStimulationId(stimulition.Id);
            IList<CY.CSTS.Core.Business.StimulationType> addlist = new List<CY.CSTS.Core.Business.StimulationType>();
            StringBuilder res = new StringBuilder();

            for (int i = 0; i < this.CheckBoxContent.Items.Count; i++)
            {
                if (CheckBoxContent.Items[i].Selected)
                {
                    res.Append(CheckBoxContent.Items[i].Value + ",");
                    if (CheckBoxContent.Items[i].Value == "分中心与协作单位")
                    {
                        bool isexit = false;
                        for (int j = 0; j < stimulationlist.Count; j++)
                        {
                            if (stimulationlist.ElementAt(j).StimulatedType == 3)
                            {
                                isexit = true;
                                CY.CSTS.Core.Business.StimulationType unit = stimulationlist.ElementAt(j);
                                unit.DateCreated = DateTime.Now;
                                unit.Des = TxtUnit1.Text;
                                unit.StimulatedType = 3;
                                unit.State = statetype;
                                unit.Save();
                            }
                        }
                        if (!isexit)
                        {
                            CY.CSTS.Core.Business.StimulationType unit = new CY.CSTS.Core.Business.StimulationType();
                            unit.DateCreated = DateTime.Now;
                            unit.Des = TxtUnit1.Text;
                            unit.StimulatedType = 3;
                            unit.State = statetype;
                            addlist.Add(unit);

                        }

                    }
                    if (CheckBoxContent.Items[i].Value == "中心")
                    {
                        bool isexit = false;
                        for (int j = 0; j < stimulationlist.Count; j++)
                        {
                            if (stimulationlist.ElementAt(j).StimulatedType == 2)
                            {
                                isexit = true;
                                CY.CSTS.Core.Business.StimulationType center = stimulationlist.ElementAt(j);
                                center.DateCreated = DateTime.Now;
                                center.Des = TxtCenter1.Text;
                                center.StimulatedType = 2;
                                center.State = statetype;
                                center.Save();
                            }

                        }
                        if (!isexit)
                        {
                            CY.CSTS.Core.Business.StimulationType center = new CY.CSTS.Core.Business.StimulationType();
                            center.DateCreated = DateTime.Now;
                            center.Des = TxtCenter1.Text;
                            center.StimulatedType = 2;
                            center.State = statetype;
                            addlist.Add(center);
                        }
                    }
                    if (CheckBoxContent.Items[i].Value == "机组")
                    {
                        bool isexit = false;
                        for (int j = 0; j < stimulationlist.Count; j++)
                        {
                            if (stimulationlist.ElementAt(j).StimulatedType == 1)
                            {
                                isexit = true;
                                CY.CSTS.Core.Business.StimulationType crew = stimulationlist.ElementAt(j);
                                crew.DateCreated = DateTime.Now;
                                crew.Des = TxtCrew1.Text;
                                crew.StimulatedType = 1;
                                crew.State = statetype;
                                crew.Save();
                            }

                        }
                        if (!isexit)
                        {
                            CY.CSTS.Core.Business.StimulationType crew = new CY.CSTS.Core.Business.StimulationType();
                            crew.DateCreated = DateTime.Now;
                            crew.Des = TxtCrew1.Text;
                            crew.StimulatedType = 1;
                            crew.State = statetype;
                            addlist.Add(crew);
                        }

                    }

                }

            }
            if (res.Length > 1)
            {
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:101,代码来源:StimulitionManagement.aspx.cs

示例3: GetTopicInfo

        /// <summary>
        /// 1获取话题(pubtopic)信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        private string GetTopicInfo(CY.UME.Core.Business.Notice notice, out bool isCut)
        {
            isCut = false;
            string result = String.Empty;

            CY.UME.Core.Business.Account author;

            if (notice.InstanceId.Length < 1)
            {
                return result;
            }

            author = CY.UME.Core.Business.Account.Load(notice.AuthorId);
            if (author == null)
            {
                return result;
            }

            Guid topicId = new Guid(notice.InstanceId);

            CY.UME.Core.Business.Topic topic = CY.UME.Core.Business.Topic.Load(topicId);
            if (topic == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }
            CY.UME.Core.Business.TopicExtend te = CY.UME.Core.Business.TopicExtend.Load(topicId);

            if (te == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            int groupId = 0;
            if (!int.TryParse(te.InstanceId, out groupId))
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            CY.UME.Core.Business.Group group = CY.UME.Core.Business.Group.Load(groupId);

            if (group == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            StringBuilder sb = new StringBuilder();

            sb.Append("{id:'");
            sb.Append(notice.Id);
            sb.Append("', authorId:");
            sb.Append(notice.AuthorId);
            sb.Append(", accountId:");
            sb.Append(notice.AccountId);
            sb.Append(", authorName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(author.Name));
            sb.Append(",content: ");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(notice.Content));//.Replace(currentAccount.Name, "我")
            sb.Append(",type:'");
            sb.Append(notice.Type);
            sb.Append("',topicId:'");
            sb.Append(topicId);
            sb.Append("',topicName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(CY.Utility.Common.StringUtility.CutString(topic.Title, 30, "...")));

            string strContent = topic.Content.Replace("\r\n", "");
            strContent = CY.Utility.Common.StringUtility.NoHTML(strContent);
            strContent = System.Web.HttpContext.Current.Server.HtmlDecode(strContent);
            strContent = strContent.Replace("&nbsp;", " ");
            strContent = strContent.Replace("\r\n", "");

            strContent = CY.Utility.Common.StringUtility.CutString(strContent.Trim(), 400, "...");
            strContent = strContent.Replace("&", "&amp;");

            sb.Append(",topicContent:" + CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(strContent));
            sb.Append(",topicDate:'" + CY.Utility.Common.StringUtility.getDateDifference(topic.DateCreated));
            sb.Append("',groupId:" + groupId);
            sb.Append(",groupName:" + CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(group.Name));
            sb.Append(",ReplyNum:" + topic.ReplyNum);
            sb.Append("},");

            result = sb.ToString();

            isCut = true;
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:101,代码来源:GetFriendNotice.ashx.cs

示例4: GetRelativeGroupInfo

        /// <summary>
        /// 7获取友情小组(relativegroup)信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        private string GetRelativeGroupInfo(CY.UME.Core.Business.Notice notice, out bool isCut)
        {
            isCut = false;
            string result = String.Empty;

            StringBuilder sb = new StringBuilder();

            CY.UME.Core.Business.Account author;

            if (notice.InstanceId.Length < 1)
            {
                return result;
            }

            author = CY.UME.Core.Business.Account.Load(notice.AuthorId);
            if (author == null)
            {
                return result;
            }

            Guid RelativeGroupId = new Guid();

            if (!Guid.TryParse(notice.InstanceId, out RelativeGroupId))
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            CY.UME.Core.Business.RelativeGroup re = CY.UME.Core.Business.RelativeGroup.Load(RelativeGroupId);

            if (re == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            CY.UME.Core.Business.Group MyGroup = CY.UME.Core.Business.Group.Load(re.GroupId);//作者的小组
            CY.UME.Core.Business.Group RelativeGroup = CY.UME.Core.Business.Group.Load(re.RelativeGroupId);//作者的有情小组

            if (MyGroup == null || RelativeGroup == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            sb.Append("{id:'");
            sb.Append(notice.Id);
            sb.Append("', authorId:'");
            sb.Append(notice.AuthorId);
            sb.Append("', accountId:'");
            sb.Append(notice.AccountId);
            sb.Append("', authorName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(author.Name));
            sb.Append(",content:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(notice.Content));
            sb.Append(",type:'");
            sb.Append(notice.Type);
            //群组信息
            sb.Append("',Date:'");
            sb.Append(CY.Utility.Common.StringUtility.getDateDifference(notice.DateCreated));
            sb.Append("',myGroupId:'" + MyGroup.Id);
            sb.Append("',myGroupName:'" + MyGroup.Name);
            sb.Append("',relativeGroupId:'" + RelativeGroup.Id);
            sb.Append("',relativeGroupName:'" + CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(RelativeGroup.Name));
            sb.Append("'},");

            isCut = true;
            return sb.ToString();
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:80,代码来源:GetFriendNotice.ashx.cs

示例5: GetPictureInfo

        /// <summary>
        /// 2获取单个图片(picture)信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        private string GetPictureInfo(CY.UME.Core.Business.Notice notice, out bool isCut)
        {
            isCut = false;
            string result = String.Empty;
            StringBuilder sb = new StringBuilder();
            CY.UME.Core.Business.Account author;
            CY.UME.Core.Business.Picture pic;
            CY.UME.Core.Business.Album album;
            long picId = 0;

            author = CY.UME.Core.Business.Account.Load(notice.AuthorId);
            if (author == null)
            {
                return result;
            }

            sb.Append("{id:");
            sb.Append(notice.Id);
            sb.Append(",type:'" + notice.Type);
            sb.Append("',authorId:");
            sb.Append(notice.AuthorId);
            sb.Append(",authorName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(author.Name));
            sb.Append(",content:" + CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(notice.Content));

            string[] arrayInstanceId = notice.InstanceId.Split(',');

            if (!long.TryParse(arrayInstanceId[0], out picId))
            {
                return result;
            }
            else
            {
                if (picId < 1) { return result; }
                else
                {
                    pic = CY.UME.Core.Business.Picture.Load(picId);
                }
            }

            if (pic == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            album = CY.UME.Core.Business.Album.Load(pic.AlbumId);
            if (album == null)
            {
                return result;
            }

            sb.Append(",albumName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(album.Name));
            sb.Append(",albumId:");
            sb.Append(album.Id);

            sb.Append(",Pictures:[");
            sb.Append("{picName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(pic.Name));
            sb.Append(",pictureId:");
            sb.Append(picId);
            sb.Append(",picDate:'");
            sb.Append(CY.Utility.Common.StringUtility.getDateDifference(pic.DateCreated));
            sb.Append("',ReplyNum:" + pic.ReplyNum);
            sb.Append("}");

            for (int i = 1; i < arrayInstanceId.Length; i++)
            {
                if (!long.TryParse(arrayInstanceId[i], out picId))
                {
                    continue;
                }

                pic = CY.UME.Core.Business.Picture.Load(picId);

                if (pic == null)
                {
                    continue;
                }

                sb.Append(",{");
                sb.Append("picName:");
                sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(pic.Name));
                sb.Append(",pictureId:");
                sb.Append(picId);
                sb.Append(",picDate:'");
                sb.Append(CY.Utility.Common.StringUtility.getDateDifference(pic.DateCreated));
                sb.Append("',ReplyNum:" + pic.ReplyNum);
                sb.Append("}");
            }

            sb.Append("]");
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:101,代码来源:GetFriendNotice.ashx.cs

示例6: GetMiniBlogInfo

        /// <summary>
        /// 4获取单个(miniblog)信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        private string GetMiniBlogInfo(CY.UME.Core.Business.Notice notice, out bool isCut)
        {
            isCut = false;
            string result = String.Empty;
            StringBuilder sb = new StringBuilder();
            CY.UME.Core.Business.Account author;
            CY.UME.Core.Business.MiniBlog miniBlog;

            long miniblogId = 0;

            if (!CY.Utility.Common.ParseUtility.TryParseInt64(notice.InstanceId, out miniblogId))
            {
                return result;
            }
            else
            {
                if (miniblogId < 1) { return result; }
                else
                {
                    miniBlog = CY.UME.Core.Business.MiniBlog.Load(miniblogId);
                }
            }

            if (miniBlog == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            author = CY.UME.Core.Business.Account.Load(notice.AuthorId);
            if (author == null)
            {
                return result;
            }

            CY.UME.Core.Business.MiniBlogExtend mbe = CY.UME.Core.Business.MiniBlogExtend.Load(miniblogId);

            bool IsPhoneSended = false;
            string picurl = String.Empty;
            string video = String.Empty;
            StringBuilder Refereds = new StringBuilder();

            Refereds.Append("{");
            if (mbe != null)
            {
                IsPhoneSended = mbe.IsPhoneSended;
                picurl = mbe.ImgPath;
                video = mbe.Video;
                if (mbe.ReferedId > 0)
                {
                    CY.UME.Core.Business.MiniBlogExtend mbeTemp = CY.UME.Core.Business.MiniBlogExtend.Load(mbe.ReferedId);
                    string name = mbe.ReferedName;
                    long id = mbe.ReferedAuthorId;
                    bool check = true;
                    long orMiniBlogId = mbe.ReferedId;
                    string orMiniBlogContent = String.Empty;
                    int orTraNum = 0;
                    int i = 0;

                    CY.UME.Core.Business.MiniBlog orMbTemp = CY.UME.Core.Business.MiniBlog.Load(mbeTemp.Id);

                    if (orMbTemp != null) orMiniBlogContent = orMbTemp.Content;//叫你们要判空,老是记不住!2010-05-11 11:17

                    Refereds.Append("TraInfo:[ ");
                    while (check)
                    {
                        if (i < 10)
                        {
                            Refereds.Append("{");
                            Refereds.Append("AccountId:" + id);
                            Refereds.Append(",Name:'" + (notice.AccountId == id ? "我" : name) + "'");
                            Refereds.Append(",MiniBlogId:" + orMiniBlogId);
                            Refereds.Append(",MiniBlogContent:" + Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(orMiniBlogContent));
                            Refereds.Append("},");
                        }

                        i++;

                        if (mbeTemp == null)
                        {
                            check = false;
                            orTraNum = CY.UME.Core.Business.MiniBlogExtend.GetMiniBlogTransferNum(orMiniBlogId);
                        }
                        else
                        {
                            if (mbeTemp.ReferedId == 0)
                            {
                                check = false;
                                orTraNum = mbeTemp.TransferedNum;
                            }
                            else
                            {
                                id = mbeTemp.ReferedAuthorId;
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:101,代码来源:GetFriendNotice.ashx.cs

示例7: GetBlogInfo

        /// <summary>
        /// 3获取单个博客(blog)信息
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        private string GetBlogInfo(CY.UME.Core.Business.Notice notice, out bool isCut)
        {
            isCut = false;
            string result = String.Empty;
            StringBuilder sb = new StringBuilder();
            CY.UME.Core.Business.Account author;
            CY.UME.Core.Business.Blog blog;

            long blogId;
            if (!CY.Utility.Common.ParseUtility.TryParseInt64(notice.InstanceId, out blogId))
            {
                return result;
            }
            else
            {
                if (blogId < 1) { return result; }
                else
                {
                    blog = CY.UME.Core.Business.Blog.Load(blogId);
                }
            }

            if (blog == null)
            {
                notice.DeleteOnSave();
                notice.Save();

                return result;
            }

            author = CY.UME.Core.Business.Account.Load(notice.AuthorId);
            if (author == null)
            {
                return result;
            }

            string strContent = blog.BlogContent.Replace("\r\n", "");
            strContent = CY.Utility.Common.StringUtility.NoHTML(strContent);
            strContent = System.Web.HttpContext.Current.Server.HtmlDecode(strContent);
            strContent = strContent.Replace("&nbsp;", " ");
            strContent = CY.Utility.Common.StringUtility.CutString(strContent.Trim(), 200, "...");
            strContent = strContent.Replace("&", "&amp;");

            sb.Append("{id:");
            sb.Append(notice.Id);
            sb.Append(",type:'" + notice.Type);
            sb.Append("',authorId:");
            sb.Append(notice.AuthorId);
            sb.Append(",authorName:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(author.Name));
            sb.Append(",content:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(notice.Content));
            sb.Append(",blogId:'");
            sb.Append(blogId);
            sb.Append("',blogSubject:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(blog.Subject));
            sb.Append(",blogContent:");
            sb.Append(CY.Utility.Common.JavaScriptUtility.ToEscapedJavaScriptString(strContent));
            sb.Append(",blogPubDate:'");
            sb.Append(CY.Utility.Common.StringUtility.getDateDifference(blog.DateCreated));
            sb.Append("',ReplyNum:" + blog.ReplyNum);
            sb.Append("},");

            result = sb.ToString();

            isCut = true;
            return result;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:73,代码来源:GetFriendNotice.ashx.cs


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