/*
* DianCMS v6.2.0 文件生成内核
* QQ:5176500 965447940 Email:diancms@qq.com 微信:18980660337
* 中国国家版权局著作权登记号：2012SR104783
* 页面生成时间：2017/6/5 17:48:54
* Copyright (c) 2009-2017 DianCMS. All rights reserved.
* 成都砺寒软件有限公司
*/

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using D.BLL;
using D.Model;
using D.Common;

public partial class Csc_aspx_User_Set_Soft_6 : System.Web.UI.Page
{
    private B_Column bllColumn = new B_Column();
    private M_Column modelColumn = null;
    private B_Model bllModel = new B_Model();
    private B_Dictionary bllDictionary = new B_Dictionary();
    private B_Admin bllAdmin = new B_Admin();
    private B_InfoModel bllInfoModel = new B_InfoModel();
    private M_InfoModel modelInfoModel = new M_InfoModel();
    private B_FilterWord bllFilterWord = new B_FilterWord();
    private B_InsideLink bllInsideLink = new B_InsideLink();
    private B_Site bllSite = new B_Site();
    private M_Site modelSite = new M_Site();
    private B_User bllUser = new B_User();
    private M_User modelUser = new M_User();
    private B_Field bllField = new B_Field();
    private B_UserAccount bllUserAccount = new B_UserAccount();
    private B_Create bllCreate = new B_Create();
    private int Id = 0;
    private int ColId = 0;
    private int PowerId = 0;
    private B_Info bllInfo = new B_Info();
    private DataRow RowInfo = null;
    private B_UserGroup bllUserGroup = new B_UserGroup();
    private M_UserGroup modelUserGroup = new M_UserGroup();
    private B_Tag bllTag=new B_Tag();
    private M_Tag modelTag=new M_Tag();
    private B_PowerGroup bllPowerGroup = new B_PowerGroup();
    private M_Admin modelAdmin = new M_Admin();
    private B_FieldStyle bllFieldStyle = new B_FieldStyle();
    private M_SiteUser modelSiteUser = new M_SiteUser();
    private B_SiteUser bllSiteUser = new B_SiteUser();
    private B_ExpandField bllExpandField = new B_ExpandField();
    private B_AutoCreate bllAutoCreate = new B_AutoCreate();
    private B_UpLoadPic bllUploadPic = new B_UpLoadPic();
    private B_Domain bllDomain = new B_Domain();
    private B_InfoIpClass bllInfoIpClass = new B_InfoIpClass();
    private B_Specifications bllSpecifications = new B_Specifications();
    private B_ModelPicPath bllModelPicPath = new B_ModelPicPath();
    private string DownFilePicPath=string.Empty;
    private string UrlReferrer=string.Empty;

    protected void Page_Load(object sender, EventArgs e)
    {
        bllUser.CheckIsLogin();
        modelUser = bllUser.GetLoginModel();
        if (modelUser == null)
        {
            Function.UserMsg(0, "<li>登录认证失败</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
        }
        modelUserGroup = bllUserGroup.GetModel(modelUser.UserGroupId);
        if (modelUserGroup == null)
        {
            Function.UserMsg(0, "<li>用户组不存在，登录失效</li><li><a href='Login.aspx'>重新登录</a> <a href='" + Param.ApplicationRootPath + "/'>返回网站首页</a></li>");
        }
        UrlReferrer = Function.UrlDecode(Request.QueryString["UrlReferrer"]);
        if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
        {
            try
            {
                Id = int.Parse(Request.QueryString["Id"]);
            }
            catch { }
        }
        if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            try
            {
                ColId = int.Parse(Request.QueryString["ColId"]);
            }
            catch { }
        }
        modelInfoModel=bllInfoModel.GetModel("D_U_Soft");
        modelSite=bllSite.GetModel();
        modelSiteUser=bllSiteUser.GetModel();
        DownFilePicPath=modelInfoModel.UploadPath;
        if(Id!=0)
        {
            RowInfo=bllInfo.GetInfo("D_U_Soft","Id",Id);
            if (RowInfo == null)
            {
                Function.UserMsg(0, "<li>访问内容不存在</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
            }
            if (UrlReferrer == null)
            {
                UrlReferrer = "infolist.aspx?ModelId=" + modelInfoModel.ModelId + "";
            }
            /*------------栏目权限判断开始(编辑信息)-------------------------*/
            if (bllCreate.CheckColumn(RowInfo, "Col"))
            {
                modelColumn = bllColumn.GetModel(int.Parse(RowInfo["Col_Id"].ToString()));
                if (!bllColumn.getColumnAddData(modelColumn.UserAddData, modelUser.UserGroupId, "edit"))
                {
                    Function.UserMsg(0, "<li>你所在的用户组无编辑权限</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
                }
            }
            /*------------栏目权限判断结束(编辑信息)-------------------------*/
        }
        /*------------栏目权限判断开始(录入信息)-------------------------*/
        if (ColId != 0)
        {
            if (UrlReferrer == null)
            {
                UrlReferrer = "infolist.aspx?ModelId=" + modelInfoModel.ModelId + "";
            }

            modelColumn = bllColumn.GetModel(ColId);
            if (Id == 0)
            {
                if (!bllColumn.getColumnAddData(modelColumn.UserAddData, modelUser.UserGroupId, "insert"))
                {
                    Function.UserMsg(0, "<li>你所在的用户组无录入权限</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
                }
            }
        }
        /*------------栏目权限判断结束(录入信息)-------------------------*/
        if(Id!=0)
        {
            int _UserId = 0;
            try
            {
                _UserId = int.Parse(RowInfo["UserId"].ToString());
            }
            catch { }
            if (_UserId != modelUser.UserId)
            {
                Function.UserMsg(0, "<li>权限读取错误</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
            }
        }

        if (!Page.IsPostBack)
        {
           AjaxPro.Utility.RegisterTypeForAjax(typeof(B_Linkage));
           AjaxPro.Utility.RegisterTypeForAjax(typeof(B_Common));
            CssName.Attributes.Add("href", "../" + B_User.GetCssName(modelUser) + "");
            P_Go.ImageUrl = "../images/control_fastforward_blue.gif";
            if(Id==0)
            {
               int _UserInfoNum = bllInfoModel.GetInsertNum(modelInfoModel.InsertNum, modelUser.UserGroupId);
               if (_UserInfoNum != 0)
               {
                   int UserInfoNum = bllInfoModel.GetUserInfoModelNum(modelUser.UserId, modelInfoModel.TableName);
                   if (UserInfoNum >= _UserInfoNum)
                   {
                       Function.UserMsg(0, "<li>" + Function.HtmlDecode(bllInfoModel.GetInsertNumTips(modelInfoModel.InsertNum, modelUser.UserGroupId)) + "</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
                   }
               }
            }
            if(Id==0)
            {
                LitModelName.Text="<a href='infolist.aspx?ModelId="+modelInfoModel.ModelId+"'>"+modelInfoModel.ModelName+"</a>";
                if (!bllUserGroup.GetInsertPower(6, modelUserGroup.InsertPower, 1))
                {
                    Function.UserMsg(0, "<li>你所在的用户组无录入权限</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
                }
                LitSetName.Text="录入信息";
            }
            else
            {
                LitModelName.Text="<a href='infolist.aspx?ModelId="+modelInfoModel.ModelId+"'>"+modelInfoModel.ModelName+"</a>";
                if (!bllUserGroup.GetInsertPower(6, modelUserGroup.InsertPower, 2))
                {
                    Function.UserMsg(0, "<li>你所在的用户组无编辑权限</li><li><a href='javascript:window.history.back()'>返回上一页</a></li>");
                }
                LitSetName.Text="编辑信息";
            }
            FilePicPath.Text=modelInfoModel.UploadPath+"|"+modelInfoModel.UploadSize;
            DianCMS_IsRecommend.Checked=false;
            DianCMS_IsFocus.Checked=false;
            DianCMS_IsHeader.Checked=false;
            DianCMS_IsTop.Checked=false;
            DianCMS_IsComment.Checked=true;
            DianCMS_IsCreate.Checked=modelInfoModel.IsCreateHtml;
            DataTable dt_SoftUnit=new DataTable();
            dt_SoftUnit=bllDictionary.GetList(3641);
            if(dt_SoftUnit.Rows.Count>0)
            {
                for(int i=0;i<dt_SoftUnit.Rows.Count;i++)
                {
                    DianCMS_SoftUnit.Items.Add(new ListItem(dt_SoftUnit.Rows[i]["Text"].ToString(), dt_SoftUnit.Rows[i]["Value"].ToString()));
                }
                DianCMS_SoftUnit.Items[0].Selected = true;
            }
            dt_SoftUnit.Dispose();
            dt_SoftUnit.Clear();

            DataTable dt_SoftProperty=new DataTable();
            dt_SoftProperty=bllDictionary.GetList(78);
            if(dt_SoftProperty.Rows.Count>0)
            {
                for(int i=0;i<dt_SoftProperty.Rows.Count;i++)
                {
                    DianCMS_SoftProperty.Items.Add(new ListItem(dt_SoftProperty.Rows[i]["Text"].ToString(), dt_SoftProperty.Rows[i]["Value"].ToString()));
                }
                DianCMS_SoftProperty.Items[0].Selected = true;
            }
            dt_SoftProperty.Dispose();
            dt_SoftProperty.Clear();

            DataTable dt_SoftLanguage=new DataTable();
            dt_SoftLanguage=bllDictionary.GetList(86);
            if(dt_SoftLanguage.Rows.Count>0)
            {
                for(int i=0;i<dt_SoftLanguage.Rows.Count;i++)
                {
                    DianCMS_SoftLanguage.Items.Add(new ListItem(dt_SoftLanguage.Rows[i]["Text"].ToString(), dt_SoftLanguage.Rows[i]["Value"].ToString()));
                }
                DianCMS_SoftLanguage.Items[0].Selected = true;
            }
            dt_SoftLanguage.Dispose();
            dt_SoftLanguage.Clear();

            DataTable dt_SoftLicence=new DataTable();
            dt_SoftLicence=bllDictionary.GetList(93);
            if(dt_SoftLicence.Rows.Count>0)
            {
                for(int i=0;i<dt_SoftLicence.Rows.Count;i++)
                {
                    DianCMS_SoftLicence.Items.Add(new ListItem(dt_SoftLicence.Rows[i]["Text"].ToString(), dt_SoftLicence.Rows[i]["Value"].ToString()));
                }
                DianCMS_SoftLicence.Items[0].Selected = true;
            }
            dt_SoftLicence.Dispose();
            dt_SoftLicence.Clear();

            DataTable dt_SoftStart=new DataTable();
            dt_SoftStart=bllDictionary.GetList(102);
            if(dt_SoftStart.Rows.Count>0)
            {
                for(int i=0;i<dt_SoftStart.Rows.Count;i++)
                {
                    DianCMS_SoftStart.Items.Add(new ListItem(dt_SoftStart.Rows[i]["Text"].ToString(), dt_SoftStart.Rows[i]["Value"].ToString()));
                }
                DianCMS_SoftStart.Items[0].Selected = true;
            }
            dt_SoftStart.Dispose();
            dt_SoftStart.Clear();



            if(Id!=0)
            {
                GetShow();
            }
        }
    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        Exists();
        string s_InsertWeb="set_Soft.aspx";
        if(Id!=0)
        {
            s_InsertWeb=RowInfo["InsertWeb"].ToString();
        }
        string s_UserId="0";
        if(Id!=0)
        {
            try
            {
                s_UserId=int.Parse(RowInfo["UserId"].ToString()).ToString();
            }
            catch { }
        }
        else
        {
            if(Request.Cookies["DianCMSUser"] != null)
            {
                s_UserId=Request.Cookies["DianCMSUser"]["UserId"];
            }
        }
        string s_UserName="";
        if(Id!=0)
        {
            s_UserName=RowInfo["UserName"].ToString();;
        }
        else
        {
            if(Request.Cookies["DianCMSUser"] != null)
            {
                s_UserName=Function.UrlDecode(Function.DesDecrypt(Request.Cookies["DianCMSUser"]["UserName"]));
            }
        }
        string s_AdminId="0";
        if(Id!=0)
        {
            try
            {
                s_AdminId=int.Parse(RowInfo["AdminId"].ToString()).ToString();
            }
            catch { }
        }
        else
        {
            if(Request.Cookies["DianCMSAdmin"] != null)
            {
                s_AdminId=Request.Cookies["DianCMSAdmin"]["AdminId"];
            }
        }
        string s_AdminName="";
        if(Id!=0)
        {
            s_AdminName=RowInfo["AdminName"].ToString();
        }
        else
        {
            if(Request.Cookies["DianCMSAdmin"] != null)
            {
                s_AdminName=Function.UrlDecode(Function.DesDecrypt(Request.Cookies["DianCMSAdmin"]["TrueName"]));
            }
        }
        string s_Ip=Function.GetIp();
        if(Id!=0)
        {
            s_Ip=RowInfo["Ip"].ToString();
        }
        string s_AddTime=DateTime.Now.AddDays(0).ToString();
        if(Id!=0)
        {
            s_AddTime=RowInfo["AddTime"].ToString();
        }
        string s_UpdateTime=DateTime.Now.ToString();
        string s_Click="0";
        if(Id!=0)
        {
            s_Click=RowInfo["Click"].ToString();
        }
        string s_Template=modelInfoModel.InfoTemplate;
        if(Id!=0)
        {
            s_Template=RowInfo["Template"].ToString();
        }
        else
        {
            if(ColId!=0)
            {
                modelColumn = bllColumn.GetModel(ColId);
                if (modelColumn != null)
                {
                    s_Template = modelColumn.InfoTemplate;
                }
            }
        }
        string s_ExpandName=modelInfoModel.InfoExpandName;
        if(Id!=0)
        {
            s_ExpandName=RowInfo["ExpandName"].ToString();
        }
        string s_Tag="";
        if(Id!=0)
        {
            s_Tag=RowInfo["Tag"].ToString();
        }
        string s_IsComment=DianCMS_IsComment.Checked.ToString();
        string s_IsCreate=DianCMS_IsCreate.Checked.ToString();
        string s_Name=Function.Encode(DianCMS_Name.Text.Trim());
        string s_Author=Function.Encode(DianCMS_Author.Text.Trim());
        string s_Pic=DianCMS_Pic.Text.Trim();
        string s_Pic_small=DianCMS_Pic_small.Text.Trim();
        if (s_Pic_small.Length == 0)
        {
            s_Pic_small = s_Pic;
        }
        string s_Content=Function.HtmlEncode(bllModelPicPath.Path2ModelPicPath(DianCMS_Content.Text.Replace(@"_ueditor_page_break_tag_", "{D:PAGE}"),DownFilePicPath));
        string s_SoftUrl = DianCMS_SoftUrl_Text.Text;
        int s_SoftUrl_click = 0;
        if (s_SoftUrl.EndsWith(","))
        {
            s_SoftUrl = s_SoftUrl.Substring(0, s_SoftUrl.Length - 1);
        }
        if(Id!=0)
        {
            try
            {
                s_SoftUrl_click=int.Parse(RowInfo["SoftUrl_click"].ToString());
            }
            catch { }
        }


        string s_SoftSize=Function.Encode(DianCMS_SoftSize.Text.Trim());
        string s_SoftUnit_Id="0";
        string s_SoftUnit=string.Empty;
        try
        {
           s_SoftUnit_Id=DianCMS_SoftUnit.SelectedValue;
           s_SoftUnit=DianCMS_SoftUnit.SelectedItem.Text.Replace("┣", "").Replace("┃", "");
        }
        catch { }
        string s_SoftVersion=Function.Encode(DianCMS_SoftVersion.Text.Trim());
        string s_SoftSource=Function.Encode(DianCMS_SoftSource.Text.Trim());
        string s_DemoUrl=Function.Encode(DianCMS_DemoUrl.Text.Trim());
        string s_Softos=Function.Encode(DianCMS_Softos.Text.Trim());
        string s_SoftProperty_Id="0";
        string s_SoftProperty=string.Empty;
        try
        {
           s_SoftProperty_Id=DianCMS_SoftProperty.SelectedValue;
           s_SoftProperty=DianCMS_SoftProperty.SelectedItem.Text.Replace("┣", "").Replace("┃", "");
        }
        catch { }
        string s_SoftLanguage_Id="0";
        string s_SoftLanguage=string.Empty;
        try
        {
           s_SoftLanguage_Id=DianCMS_SoftLanguage.SelectedValue;
           s_SoftLanguage=DianCMS_SoftLanguage.SelectedItem.Text.Replace("┣", "").Replace("┃", "");
        }
        catch { }
        string s_SoftLicence_Id="0";
        string s_SoftLicence=string.Empty;
        try
        {
           s_SoftLicence_Id=DianCMS_SoftLicence.SelectedValue;
           s_SoftLicence=DianCMS_SoftLicence.SelectedItem.Text.Replace("┣", "").Replace("┃", "");
        }
        catch { }
        string s_DecompressPassword=Function.Encode(DianCMS_DecompressPassword.Text.Trim());
        string s_SoftStart_Id="0";
        string s_SoftStart=string.Empty;
        try
        {
           s_SoftStart_Id=DianCMS_SoftStart.SelectedValue;
           s_SoftStart=DianCMS_SoftStart.SelectedItem.Text.Replace("┣", "").Replace("┃", "");
        }
        catch { }
        string s_IsRecommend=DianCMS_IsRecommend.Checked.ToString();
        string s_IsFocus=DianCMS_IsFocus.Checked.ToString();
        string s_IsHeader=DianCMS_IsHeader.Checked.ToString();
        string s_IsTop=DianCMS_IsTop.Checked.ToString();

        #region
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("FieldName", typeof(string)));
        dt.Columns.Add(new DataColumn("FieldValue", typeof(string)));
        dt.Columns.Add(new DataColumn("FieldData", typeof(string)));
        DataRow drinfo = null;
        drinfo = dt.NewRow();
        drinfo[0] = "InsertWeb";
        drinfo[1] = s_InsertWeb;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "UserId";
        drinfo[1] = s_UserId;
        drinfo[2] = "Integer";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "UserName";
        drinfo[1] = s_UserName;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "AdminId";
        drinfo[1] = s_AdminId;
        drinfo[2] = "Integer";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "AdminName";
        drinfo[1] = s_AdminName;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Ip";
        drinfo[1] = s_Ip;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "AddTime";
        drinfo[1] = s_AddTime;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "UpdateTime";
        drinfo[1] = s_UpdateTime;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Click";
        drinfo[1] = s_Click;
        drinfo[2] = "Integer";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Template";
        drinfo[1] = s_Template;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "ExpandName";
        drinfo[1] = s_ExpandName;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Tag";
        drinfo[1] = s_Tag;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "IsComment";
        drinfo[1] = s_IsComment;
        drinfo[2] = "Boolean";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "IsCreate";
        drinfo[1] = s_IsCreate;
        drinfo[2] = "Boolean";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Name";
        drinfo[1] = s_Name;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Author";
        drinfo[1] = s_Author;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Pic";
        drinfo[1] = s_Pic;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Pic_small";
        drinfo[1] = s_Pic_small;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Content";
        drinfo[1] = s_Content;
        drinfo[2] = "LongVarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftUrl";
        drinfo[1] = s_SoftUrl;
        drinfo[2] = "LongVarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftUrl_click";
        drinfo[1] = s_SoftUrl_click;
        drinfo[2] = "Integer";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftSize";
        drinfo[1] = s_SoftSize;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftUnit";
        drinfo[1] = s_SoftUnit;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftUnit_Id";
        drinfo[1] = s_SoftUnit_Id;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftVersion";
        drinfo[1] = s_SoftVersion;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftSource";
        drinfo[1] = s_SoftSource;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "DemoUrl";
        drinfo[1] = s_DemoUrl;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "Softos";
        drinfo[1] = s_Softos;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftProperty";
        drinfo[1] = s_SoftProperty;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftProperty_Id";
        drinfo[1] = s_SoftProperty_Id;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftLanguage";
        drinfo[1] = s_SoftLanguage;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftLanguage_Id";
        drinfo[1] = s_SoftLanguage_Id;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftLicence";
        drinfo[1] = s_SoftLicence;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftLicence_Id";
        drinfo[1] = s_SoftLicence_Id;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "DecompressPassword";
        drinfo[1] = s_DecompressPassword;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftStart";
        drinfo[1] = s_SoftStart;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "SoftStart_Id";
        drinfo[1] = s_SoftStart_Id;
        drinfo[2] = "VarChar";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "IsRecommend";
        drinfo[1] = s_IsRecommend;
        drinfo[2] = "Boolean";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "IsFocus";
        drinfo[1] = s_IsFocus;
        drinfo[2] = "Boolean";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "IsHeader";
        drinfo[1] = s_IsHeader;
        drinfo[2] = "Boolean";
        dt.Rows.Add(drinfo);

        drinfo = dt.NewRow();
        drinfo[0] = "IsTop";
        drinfo[1] = s_IsTop;
        drinfo[2] = "Boolean";
        dt.Rows.Add(drinfo);


        if (Id != 0)
        {
            drinfo = dt.NewRow();
            drinfo[0] = "Id";
            drinfo[1] = Id;
            drinfo[2] = "Integer";
            dt.Rows.Add(drinfo);
        }
        #endregion
        if (Id == 0)
        {
            //检测积分
            bllInfoModel.ExistsIntegralAndPoint("D_U_Soft",modelUser.UserId,1);
            //添加信息
            Id = bllModel.AddInfoModel("D_U_Soft",dt);
            //投稿获得积分
            bllInfoModel.ContributeHortation("D_U_Soft",0,Id);
            Function.UserMsg(1,"<li>成功添加信息</li><li><a href='info/infolist.aspx?ModelId="+modelInfoModel.ModelId+"'>返回信息列表</a> <a href='info/Set_Soft_6.aspx?Id=" + Id + "'>修改信息</a> <a href='info/Set_Soft_6.aspx'>继续添加信息</a></li>");
        }
        else
        {
            //修改信息
            bllModel.UpdateInfoModel("D_U_Soft",dt,"Id");
            Function.UserMsg(1,"<li>成功修改信息</li><li><a href='"+UrlReferrer+"'>返回信息列表</a> <a href='info/Set_Soft_6.aspx?Id=" + Id + "&UrlReferrer=" + Function.UrlEncode(UrlReferrer) + "'>修改信息</a> <a href='info/Set_Soft_6.aspx'>继续添加信息</a></li>");
        }

    }

    private void Exists()
    {
    }

    private void GetShow()
    {
        DianCMS_Name.Text=Function.Decode(RowInfo["Name"].ToString());
        DianCMS_Author.Text=Function.Decode(RowInfo["Author"].ToString());
        DianCMS_Pic.Text=RowInfo["Pic"].ToString();
        DianCMS_Pic_small.Text=RowInfo["Pic_small"].ToString();
        try
        {
          DianCMS_IsRecommend.Checked=bool.Parse(RowInfo["IsRecommend"].ToString());
        }
        catch
        {
        }
        try
        {
          DianCMS_IsFocus.Checked=bool.Parse(RowInfo["IsFocus"].ToString());
        }
        catch
        {
        }
        try
        {
          DianCMS_IsHeader.Checked=bool.Parse(RowInfo["IsHeader"].ToString());
        }
        catch
        {
        }
        try
        {
          DianCMS_IsTop.Checked=bool.Parse(RowInfo["IsTop"].ToString());
        }
        catch
        {
        }
        try
        {
          DianCMS_IsComment.Checked=bool.Parse(RowInfo["IsComment"].ToString());
        }
        catch
        {
        }
        try
        {
          DianCMS_IsCreate.Checked=bool.Parse(RowInfo["IsCreate"].ToString());
        }
        catch
        {
        }
        DianCMS_Content.Text=Function.HtmlDecode(bllModelPicPath.ModelPicPath2Path(Regex.Replace(RowInfo["Content"].ToString(),@"{D:PAGE}", "_ueditor_page_break_tag_",RegexOptions.IgnoreCase),DownFilePicPath));
        string s_SoftUrl = RowInfo["SoftUrl"].ToString();
        DianCMS_SoftUrl_Text.Text = s_SoftUrl;
        if (s_SoftUrl.Length > 0)
        {
            string[] _s_SoftUrl = s_SoftUrl.Split(',');
            for (int i = 0; i < _s_SoftUrl.Length; i++)
            {
                DianCMS_SoftUrl.Items.Add(new ListItem(_s_SoftUrl[i], _s_SoftUrl[i]));
            }
       }
        DianCMS_SoftSize.Text=Function.Decode(RowInfo["SoftSize"].ToString());
        DianCMS_SoftUnit.SelectedValue=RowInfo["SoftUnit_Id"].ToString();
        DianCMS_SoftVersion.Text=Function.Decode(RowInfo["SoftVersion"].ToString());
        DianCMS_SoftSource.Text=Function.Decode(RowInfo["SoftSource"].ToString());
        DianCMS_DemoUrl.Text=Function.Decode(RowInfo["DemoUrl"].ToString());
        DianCMS_Softos.Text=Function.Decode(RowInfo["Softos"].ToString());
        DianCMS_SoftProperty.SelectedValue=RowInfo["SoftProperty_Id"].ToString();
        DianCMS_SoftLanguage.SelectedValue=RowInfo["SoftLanguage_Id"].ToString();
        DianCMS_SoftLicence.SelectedValue=RowInfo["SoftLicence_Id"].ToString();
        DianCMS_DecompressPassword.Text=Function.Decode(RowInfo["DecompressPassword"].ToString());
        DianCMS_SoftStart.SelectedValue=RowInfo["SoftStart_Id"].ToString();
    }

}