<%@ 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.XTextBox4.Text = state;
    }
</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="Stylesheet" type="text/css" />
    <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}
    </style>
    <script type="text/javascript">
        function CompanyID() {
            if (agent.Eles[document.getElementById("XTextBox4").getAttribute("xform_xele_index")].getValue() != "Edit") {
                YZSoft.Ajax.request({
                    url: YZSoft.$url('Oimec/HR/Services/HRSysMGTHandler.ashx'),
                    method: 'POST',
                    params: {
                        method: 'IsHRCompanyIDExist',
                        CompanyID: agent.Eles[document.getElementById("XTextBox1").getAttribute("xform_xele_index")].getValue()
                    },
                    success: function (action) {
                        if (action.result.Value > 0) {
                            alert('您添加的公司编号已存在！请重新添加！');
                            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" text="公司维护" valuetodisplaytext value></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" class="td">
                        <asp:Label id="XLabel1" runat="server" text="公司编号" valuetodisplaytext value></asp:Label>
                        <aspxform:XTextBox id="XTextBox4" runat="server" BorderColor="#DCDCDC" BorderWidth="1" width="20px"  HiddenExpress="1"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox3" runat="server" BorderColor="#DCDCDC" BorderWidth="1" width="20px" Express="javascript('CompanyID',DF_HR_OrgCompany.CompanyID)" HiddenExpress="1"></aspxform:XTextBox>
                    </td>
                    <td class="td1" style="WIDTH: 8%">
                        <aspxform:XTextBox id="XTextBox1" onblur="CompanyID();" runat="server" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px" width="60%" XDataBind="DF_HR_OrgCompany.CompanyID" Max="0" Min="0" HiddenInput="False"></aspxform:XTextBox>
                    </td>
                    <td width="62" class="td">
                        <asp:Label id="XLabel3" runat="server" text="公司名称" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 8%">
                        <aspxform:XTextBox id="XTextBox2" runat="server" BorderColor="#DCDCDC" BorderWidth="1" width="70%" XDataBind="DF_HR_OrgCompany.CompanyName"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <p align="center">
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator8" runat="server" ControlToValidate="XTextBox1" ErrorMessage="请填写公司编号"></aspxform:XRequiredFieldValidator>
            &nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ControlToValidate="XTextBox2" ErrorMessage="请填写公司名称"></aspxform:XRequiredFieldValidator>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        </p>
    </form>
</body>
</html>
