<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    // Insert page code here
    //
    protected void Page_Load(object sender, EventArgs e)
    {
    
        string state = Request.QueryString["formstate"];
        this.XTextBox6.Text = state;
    }

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="Stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <title>BPM Form</title> <style>
    BODY {FONT-SIZE: 12px; FONT-FAMILY: verdana}
    TABLE {border-collapse: collapse; FONT-SIZE: 12px; FONT-FAMILY: verdana}
    P {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; FONT-SIZE: 12px; FONT-FAMILY: verdana}
    TD {PADDING-RIGHT: 0px; PADDING-LEFT: 2px; PADDING-BOTTOM: 0px}
    TD.NoPadding {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}
    INPUT {HEIGHT: 20px}
    INPUT.UL {BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: #33ff33 1px solid}
    TEXTAREA {FONT-SIZE:12px}
    .yz-textbox{display:inline;}
    </style>
    <script type="text/javascript">
    function BUID() {
      
        if (agent.Eles[document.getElementById("XTextBox6").getAttribute("xform_xele_index")].getValue() != "Edit") {
            YZSoft.Ajax.request({
                url: YZSoft.$url('Oimec/SysMaint/Services/HROrgHandler.ashx'),
                method: 'POST',
                params: {
                    method: 'IsHRBUNoExist',
                    BUNO: agent.Eles[document.getElementById("XTextBox1").getAttribute("xform_xele_index")].getValue()
                },
                success: function (action) {
                    var result = action.result;
                    if (action.result.Value > 0) {
                        alert("您添加的BU编号已存在！请重新添加！");
                        agent.Eles[document.getElementById("XTextBox1").getAttribute("xform_xele_index")].setValue("");
                    }
                }
            });
        }
    }
</script>
</head>
<body>
    <form id="Form1" runat="server">
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo">
                    </td>
                    <td class="biaoti">
                        <asp:Label id="XLabel2" runat="server" value valuetodisplaytext text="BU维护"></asp:Label></td>
                    <%--<td class="formno">
                        <aspxform:XLabel id="XLabel93" runat="server" text="表单号：" ValueToDisplayText Value></aspxform:XLabel>
                        <aspxform:XLabel id="XLabel94" runat="server" text="--系统自动生成--" ValueToDisplayText Value XDataBind="DF_HR_NEWSTAFFAPP.FormNo"></aspxform:XLabel>
                    </td>--%>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td width="62" height="42" class="td">
                        <asp:Label id="XLabel4" runat="server" value valuetodisplaytext text="公司编号"></asp:Label>
                        <aspxform:XTextBox id="XTextBox5" runat="server" Express="javascript('BUID',DF_HR_OrgBU.BUID)" width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox6" runat="server" width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1"></aspxform:XTextBox>
                    </td>
                    <td class="td1" style="WIDTH: 8%">
                        <aspxform:XTextBox id="XTextBox3" runat="server" width="60%" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_HR_OrgBU.CompanyID" BackColor="#E6F1F8" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td width="62" class="td">
                        <asp:Label id="XLabel5" runat="server" value valuetodisplaytext text="公司名称"></asp:Label></td>
                    <td class="td1" style="WIDTH: 8%">
                        <aspxform:XTextBox id="XTextBox4" runat="server" width="200px" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_HR_OrgBU.CompanyName" BackColor="#E6F1F8" ReadOnly="True"></aspxform:XTextBox>
                        <aspxform:XDataBrowserButton id="XDataBrowserButton1" runat="server" Text="查询" DataMap="CompanyID->DF_HR_OrgBU.CompanyID;CompanyName->DF_HR_OrgBU.CompanyName" DisplayColumns="CompanyID:公司编号,;CompanyName:公司名称," XDataSource="TableName:V_DF_HR_OrgMaintenance_Company" Width="50px"></aspxform:XDataBrowserButton>
                    </td>
                </tr>
                <tr>
                    <td width="62" class="td">
                        <asp:Label id="XLabel1" runat="server" value valuetodisplaytext text="BU编号"></asp:Label></td>
                    <td class="td1" style="WIDTH: 8%">
                        <aspxform:XTextBox id="XTextBox1" onblur="BUID();" runat="server" width="60%" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_HR_OrgBU.BUID"></aspxform:XTextBox>
                    </td>
                    <td width="62" class="td">
                        <asp:Label id="XLabel3" runat="server" value valuetodisplaytext text="BU名称"></asp:Label></td>
                    <td class="td1" style="WIDTH: 8%">
                        <aspxform:XTextBox id="XTextBox2" runat="server" width="70%" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_HR_OrgBU.BUName"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <p align="center">
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" runat="server" ErrorMessage="请选择公司名称" ControlToValidate="XTextBox4"></aspxform:XRequiredFieldValidator>
            &nbsp;&nbsp;&nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator8" runat="server" ErrorMessage="请填写BU编号" ControlToValidate="XTextBox1"></aspxform:XRequiredFieldValidator>
            &nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ErrorMessage="请填写BU名称" ControlToValidate="XTextBox2"></aspxform:XRequiredFieldValidator>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        </p>
    </form>
</body>
</html>
