using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KstCMS.KstCMS_Manager.SystemSet.SoftFace.Reg
{
    public partial class index : KstCmsBase.WebPage.ValidationPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Button1.Click += new EventHandler(Button1_Click);
            if (!IsPostBack)
            {
                Get_UnitInfo();
            }
        }

        void Button1_Click(object sender, EventArgs e)
        {
            string[] FieldValues = new string[] { WebTitle.Text.Trim(), SoftName.Text.Trim(), UNIT_NAME.Text.Trim(), TEL_NO.Text.Trim(), FAX_NO.Text.Trim(), POST_NO.Text.Trim(), ADDRESS.Text.Trim(), EMAIL.Text.Trim(), HTTP_URL.Text.Trim(), IBM_CODE.Text.Trim(), REG_CODE.Text.Trim() };
            int r = KstCmsBase.DAL.Regedit.Update(FieldValues, 1, "WEBTITLE", "SOFTNAME", "COMNAME", "TEL", "FAX", "ZIP", "ADDRESS", "EMAIL", "URL", "IBM_CODE", "REG_CODE");
            if (r > 0)
            {
                ShowMsgModle("更新成功！");
            }
        }

        void Get_UnitInfo()
        {
            KstCmsBase.Entities.UserUnit Unit = KstCmsBase.DAL.Regedit.Get_UnitInfo();
            WebTitle.Text = Unit.WEBTITLE;
            SoftName.Text = Unit.SOFTNAME;
            UNIT_NAME.Text = Unit.COMNAME;
            TEL_NO.Text = Unit.TEL;
            FAX_NO.Text = Unit.FAX;
            POST_NO.Text = Unit.ZIP;
            ADDRESS.Text = Unit.ADDRESS;
            EMAIL.Text = Unit.EMAIL;
            HTTP_URL.Text = Unit.URL;
            IBM_CODE.Text = Unit.IBM_CODE;
            REG_CODE.Text = "";

        }
    }
}