Ejemplo n.º 1
0
        /// <summary>
        /// baocun
        /// </summary>
        void BaoCun()
        {
            var info = new EyouSoft.Model.YlStructure.MWzYouQingLianJieInfo();

            info.CompanyId  = CurrentUserCompanyID;
            info.Filepath   = null;
            info.IssueTime  = DateTime.Now;
            info.MingCheng  = Utils.GetFormValue(txtMingCheng.UniqueID);
            info.OperatorId = SiteUserInfo.UserId;
            info.LianJieId  = LianJieId;
            info.Url        = Utils.GetFormValue(txtUrl.UniqueID);

            var items  = upload1.Files;
            var items1 = upload1.YuanFiles;

            if (items != null && items.Count > 0)
            {
                info.Filepath = items[0].FilePath;
            }
            else if (items1 != null && items1.Count > 0)
            {
                info.Filepath = items1[0].FilePath;
            }

            if (this.YouQingLianJieLeiXing.HasValue)
            {
                info.LeiXing = YouQingLianJieLeiXing.Value;
            }
            else
            {
                info.LeiXing = EyouSoft.Model.EnumType.YlStructure.WzYouQingLianJieLeiXing.图文;
                if (string.IsNullOrEmpty(info.Filepath))
                {
                    info.LeiXing = EyouSoft.Model.EnumType.YlStructure.WzYouQingLianJieLeiXing.文本;
                }
            }

            int bllRetCode = 0;

            if (string.IsNullOrEmpty(LianJieId))
            {
                bllRetCode = new EyouSoft.BLL.YlStructure.BWz().InsertYouQingLianJie(info);
            }
            else
            {
                bllRetCode = new EyouSoft.BLL.YlStructure.BWz().UpdateYouQingLianJie(info);
            }

            if (bllRetCode == 1)
            {
                RCWE(UtilsCommons.AjaxReturnJson("1", "操作成功"));
            }
            else
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败"));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 写入友情链接信息,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int InsertYouQingLianJie(EyouSoft.Model.YlStructure.MWzYouQingLianJieInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CompanyId) ||
                string.IsNullOrEmpty(info.OperatorId))
            {
                return(0);
            }

            info.LianJieId = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;

            int dalRetCode = dal.InsertYouQingLianJie(info);

            return(dalRetCode);
        }