<%@ Page Language="c#" CodeBehind="PostUser.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.Personnel.PostUser"
    Title="员工编辑-人事" %>

<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../UserCol/Dictionary.ascx" TagName="Dictionary" TagPrefix="uc1" %>
<%@ Register Src="../UserCol/FingerCode.ascx" TagName="FingerCode" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">

        function DeleteImage() {
            if (__mt_editmode && __mt_photo) {
                var btnDel = document.getElementById("lbnDelete");
                btnDel.style.visibility = "visible";
                btnDel.style.width = "100%";
                btnDel.style.height = "100%";
            }
        }

        function ftp(evt) {
            document.getElementById("fileImage").click();
        }

        window.onload = function () {
            document.getElementById('fileImage').onchange = function (evt) {
                Preview(evt);
            }

            //__mt_addTableLeftCss('tb');
            //_addressInit();
        }

        function Preview(evt) {

            if (!window.FileReader) {
                var file = document.getElementById("fileImage");
                var cimgurl = document.getElementById("imgUrl");
                var preview = document.getElementById("__mt_Preview");

                if (file.value != "") {
                    preview.height = 16;
                    preview.src = file.value;
                    preview.height = picheight;
                    cimgurl.value = file.value;
                }

                return;
            }

            var files = evt.target.files;
            for (var i = 0, f; f = files[i]; i++) {
                if (!f.type.match('image.*')) {
                    continue;
                }

                var reader = new FileReader();
                reader.onload = (function (theFile) {

                    return function (e) {

                        var file = document.getElementById("fileImage");
                        var cimgurl = document.getElementById("imgUrl");
                        var preview = document.getElementById("__mt_Preview");

                        if (file.value != "") {
                            preview.height = 16;
                            preview.src = file.value;
                            preview.height = picheight;
                            cimgurl.value = file.value;
                            preview.src = e.target.result;
                        }
                    };

                })(f);

                reader.readAsDataURL(f);
            }

        }

        function __mt_CallbackCamera(type, path, data) {
            var preview = document.getElementById("__mt_Preview");
            var _data = "data:image/jpeg;base64," + data;
            preview.src = _data;

            document.getElementById("imgUrl").value = path;
            document.getElementById("imgByteString").value = data;
        }

    </script>
</head>
<body>
    <div class="printWeb">
        <iframe id="PickPanel" width="0" height="0"></iframe>
    </div>
    <form id="Form1" method="post" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div class="divpanel">
            <table class="table" cellspacing="0">
                <tr>
                    <th colspan="3">编辑员工信息
                    </th>
                </tr>
                <tr>
                    <td>姓名：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxTrueName" runat="server"></asp:TextBox>
                        <span style="color: Red">*</span>
                    </td>
                </tr>
                <tr>
                    <td>性别：
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rblSex" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0" Text="女" Selected="True"></asp:ListItem>
                            <asp:ListItem Value="1" Text="男"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td rowspan="10" style="text-align: center">
                            <div style="position: relative; display: inline-block;">
                                <asp:Image ID="__mt_Preview" runat="server" ImageUrl='<%#accTheme("pic.gif") %>' onclick="DeleteImage()"></asp:Image>
                                <div style="text-align: center; position: absolute; bottom: 10px; right: 10px; width: 30px; height: 20px; z-index: 100;">
                                    <asp:LinkButton ID="lbnDelete" runat="server" OnClick="lbnDelete_Click" Style="visibility: hidden; background-color: gold; display: inline-block"
                                        CausesValidation="false">删除</asp:LinkButton>
                                </div>
                            </div>
                    </td>
                </tr>
                <tr>
                    <td>生日：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxBirthday" runat="server"></asp:TextBox>
                        <script type="text/javascript">                        Calendar("tbxBirthday");</script>
                        <span style="color: Red">*</span>
                    </td>
                </tr>
                <tr>
                    <td>选择相片：
                    </td>
                    <td>
                        <div style="margin-top: 10px">
                            <input id="fileImage" type="file" accept="Image/*" runat="server" />
                            <div class="inline_block tool_camera" onclick="Avicap();">
                            </div>
                        </div>
                        <div style="display: none">
                            <asp:HiddenField ID="imgByteString" runat="server" />
                            <asp:HiddenField ID="imgUrl" runat="server" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>是否兼职：
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rblPluralist" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0" Text="否" Selected="True"></asp:ListItem>
                            <asp:ListItem Value="1" Text="是"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>是否授课：
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rblIsTeacher" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0" Text="否" Selected="True"></asp:ListItem>
                            <asp:ListItem Value="1" Text="是"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>任聘日期：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxComeDate" runat="server"></asp:TextBox>
                        <span style="color: Red">*</span>
                    </td>
                </tr>
                <tr>
                    <td>合同到期：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxContractDate" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>离职日期：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxOutDate" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>所教课程：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxCourse" runat="server" Width="223px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>毕业学校：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxFinishSchool" runat="server" Width="224px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>学历：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxDiploma" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>简历：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxResume" runat="server" TextMode="MultiLine" Width="438px" Height="128px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>联系电话：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxTel" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>手机：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxMobileTel" runat="server"></asp:TextBox>
                        (接收短信默认号码)
                    </td>
                </tr>
                <tr>
                    <td>电子邮件：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxUserEmail" runat="server" Width="199px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>通信地址：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxHomeAddress" runat="server" Width="352px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>邮编：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxPostCode" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>职务：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxHeadship" runat="server" Width="198px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>身份证号：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxIDcard" runat="server" Width="269px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>ＩＤ卡号：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxSignInID" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>基本工资：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxBasePay" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>课时费：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxHourFee" runat="server"></asp:TextBox>
                        (每小时薪资)
                    </td>
                </tr>
                <tr runat="server" id="c1">
                    <td width="13%">
                        <asp:Label ID="labCustom1" runat="server"></asp:Label>
                    </td>
                    <td colspan="2" width="823">
                        <asp:TextBox ID="tbxCustom1" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr runat="server" id="c2">
                    <td width="13%">
                        <asp:Label ID="labCustom2" runat="server"></asp:Label>
                    </td>
                    <td colspan="2" width="823">
                        <asp:TextBox ID="tbxCustom2" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr runat="server" id="c3">
                    <td width="13%">
                        <asp:Label ID="labCustom3" runat="server"></asp:Label>
                    </td>
                    <td colspan="2" width="823">
                        <asp:TextBox ID="tbxCustom3" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr runat="server" id="c4">
                    <td width="13%">
                        <asp:Label ID="labCustom4" runat="server"></asp:Label>
                    </td>
                    <td colspan="2" width="823">
                        <asp:TextBox ID="tbxCustom4" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr runat="server" id="c5">
                    <td width="13%">
                        <asp:Label ID="labCustom5" runat="server"></asp:Label>
                    </td>
                    <td colspan="2" width="823">
                        <asp:TextBox ID="tbxCustom5" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>校区：
                    </td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlSchool" runat="server" DataTextField="SchoolName" DataValueField="SchoolID">
                        </asp:DropDownList>
                        <span style="color: Red">*</span>
                    </td>
                </tr>
                <tr runat="server" id="trGroup">
                    <td>隶属组：
                    </td>
                    <td colspan="2">
                        <table>
                            <tr>
                                <td>隶属组
                                </td>
                                <td>&nbsp;
                                </td>
                                <td>所有组
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:ListBox ID="lbxSelected" runat="server" Height="237px" Width="245px" SelectionMode="Multiple"></asp:ListBox>
                                </td>
                                <td>
                                    <label class="lab_button">
                                        <asp:DropDownList ID="ddlSchool0" runat="server" DataTextField="SchoolName" DataValueField="SchoolID">
                                        </asp:DropDownList>
                                    </label>
                                    <br />
                                    <br />
                                    <label class="lab_button">
                                        <asp:Button ID="btnAddUser" runat="server" Height="24px" Text="&lt;加入" OnClick="btnAddUser_Click" Width="91px" />
                                    </label>
                                    <br />
                                    <br />
                                    <label class="lab_button">
                                        <asp:Button ID="btnRemoveUser" runat="server" Height="24px" Text="&gt;移除" OnClick="btnRemoveUser_Click" Width="91px" />
                                    </label>
                                </td>
                                <td>
                                    <asp:ListBox ID="lbxUserGroups" runat="server" Height="232px" Width="251px" SelectionMode="Multiple"></asp:ListBox>
                                    <span style="color: Red">*</span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>指纹状态：
                    </td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlFingerState" runat="server">
                            <asp:ListItem Value="0">禁用</asp:ListItem>
                            <asp:ListItem Selected="True" Value="1">可用</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>指纹模板：
                    </td>
                    <td colspan="2">
                        <uc2:FingerCode ID="tbxFingerCode" runat="server" />
                    </td>
                </tr>
                <tr style="display: none">
                    <td>网站显示：
                    </td>
                    <td colspan="2">
                        <asp:RadioButtonList ID="rblLockWeb" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0" Text="否" Selected="True"></asp:ListItem>
                            <asp:ListItem Value="1" Text="是"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="2">
                        <label class="lab_button">
                            <asp:Button ID="btnPost" runat="server" Text="提交" OnClick="btnPost_Click"></asp:Button>
                        </label>
                        <label class="lab_button" id="__mt_labBack" runat="server">
                            <input causesvalidation="false" type="button" runat="server" onclick="back(this)" value="返回" />
                        </label>
                    </td>
                </tr>
            </table>
        </div>
        <!------usercol ajax-------->
        <asp:UpdatePanel ID="up" runat="server">
            <ContentTemplate>
                <uc1:Dictionary ID="Dictionary1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <!-------usercol ajax------->
    </form>
</body>
</html>
