protected void Button_Export_Click(object sender, EventArgs e)
        {
            string        exception     = "";
            string        evaluatedID   = Request.QueryString["id"];
            EvaluateTable evaluateTable = new EvaluateTable();

            if (EvaluateTableManagementCtrl.GetEvaluateTable(evaluatedID, ref evaluateTable, ref exception))
            {
                string filename = "";
                if (ExportManagementCtrl.ExportEvaluateTable(ref filename, evaluateTable, ref exception))
                {
                    Response.ClearContent();
                    Response.ContentType = "application/excel";
                    Response.AddHeader("content-disposition", "attachment;filename=" + Server.UrlEncode(filename));
                    string path = Server.MapPath("..\\..\\downloadfiles\\" + filename);
                    Response.TransmitFile(path);
                }
                else
                {
                    Alert.ShowInTop("导出失败!\n原因:" + exception, MessageBoxIcon.Error);
                }
            }
            else
            {
                Alert.ShowInTop("导出失败!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }
        private void loadEvaluateTable()
        {
            string exception   = "";
            string evaluatedID = Request.QueryString["id"];
            string name        = Request.QueryString["name"];

            Panel1.Title = name + "的考核表";
            EvaluateTable evaluateTable = new EvaluateTable();

            if (EvaluateTableManagementCtrl.GetEvaluateTable(evaluatedID, ref evaluateTable, ref exception))
            {
                Label_EvaluatedName.Text = evaluateTable.EvaluatedName;
                Label_PostName.Text      = evaluateTable.PostName;
                Label_LaborDep.Text      = evaluateTable.LaborDep;
                Label_LaborUnit.Text     = evaluateTable.LaborUnit;
                Label_Period.Text        = evaluateTable.StartTime + " ~ " + evaluateTable.StopTime;

                int count = 1;
                foreach (Quota item in evaluateTable.KeyResponse)
                {
                    SimpleForm sf = new SimpleForm();
                    sf.ID          = "SimpleForm_KeyResponse_" + count;
                    sf.ShowHeader  = false;
                    sf.ShowBorder  = true;
                    sf.BodyPadding = "5px";
                    FineUI.TextBox tb = new FineUI.TextBox();
                    tb.ID       = "TextBox_KeyResponse_" + count;
                    tb.Label    = "标题";
                    tb.Text     = item.Title;
                    tb.Readonly = true;
                    sf.Items.Add(tb);
                    FineUI.TextArea ta = new FineUI.TextArea();
                    ta.ID       = "TextArea_KeyResponse_" + count;
                    ta.Label    = "内容";
                    ta.Text     = item.Content[0];
                    ta.Readonly = true;
                    sf.Items.Add(ta);
                    Panel3.Items.Add(sf);
                    count++;
                }

                count = 1;
                foreach (Quota item in evaluateTable.KeyQualify)
                {
                    SimpleForm sf = new SimpleForm();
                    sf.ID          = "SimpleForm_KeyQualify_" + count;
                    sf.ShowHeader  = false;
                    sf.ShowBorder  = true;
                    sf.BodyPadding = "5px";
                    FineUI.TextBox tb = new FineUI.TextBox();
                    tb.ID       = "TextBox_KeyQualify_" + count;
                    tb.Label    = "标题";
                    tb.Text     = item.Title;
                    tb.Readonly = true;
                    sf.Items.Add(tb);
                    FineUI.TextArea ta = new FineUI.TextArea();
                    ta.ID    = "TextArea_KeyQualify_" + count;
                    ta.Label = "内容";
                    ta.Text  = "优:" + item.Content[0]
                               + "良:" + item.Content[1]
                               + "中:" + item.Content[2]
                               + "差:" + item.Content[3];
                    ta.Readonly = true;
                    sf.Items.Add(ta);
                    Panel4.Items.Add(sf);
                    count++;
                }

                count = 1;
                foreach (Quota item in evaluateTable.KeyAttitude)
                {
                    SimpleForm sf = new SimpleForm();
                    sf.ID          = "SimpleForm_KeyAttitude_" + count;
                    sf.ShowHeader  = false;
                    sf.ShowBorder  = true;
                    sf.BodyPadding = "5px";
                    FineUI.TextBox tb = new FineUI.TextBox();
                    tb.ID       = "TextBox_KeyAttitude_" + count;
                    tb.Label    = "标题";
                    tb.Text     = item.Title;
                    tb.Readonly = true;
                    sf.Items.Add(tb);
                    FineUI.TextArea ta = new FineUI.TextArea();
                    ta.ID    = "TextArea_KeyAttitude_" + count;
                    ta.Label = "内容";
                    ta.Text  = "优:" + item.Content[0]
                               + "良:" + item.Content[1]
                               + "中:" + item.Content[2]
                               + "差:" + item.Content[3];
                    ta.Readonly = true;
                    sf.Items.Add(ta);
                    Panel5.Items.Add(sf);
                    count++;
                }

                count = 1;
                foreach (Quota item in evaluateTable.Response)
                {
                    SimpleForm sf = new SimpleForm();
                    sf.ID          = "SimpleForm_Response_" + count;
                    sf.ShowHeader  = false;
                    sf.ShowBorder  = true;
                    sf.BodyPadding = "5px";
                    FineUI.TextBox tb = new FineUI.TextBox();
                    tb.ID       = "TextBox_Response_" + count;
                    tb.Label    = "标题";
                    tb.Text     = item.Title;
                    tb.Readonly = true;
                    sf.Items.Add(tb);
                    FineUI.TextArea ta = new FineUI.TextArea();
                    ta.ID       = "TextArea_Response_" + count;
                    ta.Label    = "内容";
                    ta.Text     = item.Content[0];
                    ta.Readonly = true;
                    sf.Items.Add(ta);
                    Panel6.Items.Add(sf);
                    count++;
                }

                count = 1;
                foreach (Quota item in evaluateTable.Qualify)
                {
                    SimpleForm sf = new SimpleForm();
                    sf.ID          = "SimpleForm_Qualify_" + count;
                    sf.ShowHeader  = false;
                    sf.ShowBorder  = true;
                    sf.BodyPadding = "5px";
                    FineUI.TextBox tb = new FineUI.TextBox();
                    tb.ID       = "TextBox_Qualify_" + count;
                    tb.Label    = "标题";
                    tb.Text     = item.Title;
                    tb.Readonly = true;
                    sf.Items.Add(tb);
                    FineUI.TextArea ta = new FineUI.TextArea();
                    ta.ID    = "TextArea_Qualify_" + count;
                    ta.Label = "内容";
                    ta.Text  = "优:" + item.Content[0]
                               + "良:" + item.Content[1]
                               + "中:" + item.Content[2]
                               + "差:" + item.Content[3];
                    ta.Readonly = true;
                    sf.Items.Add(ta);
                    Panel7.Items.Add(sf);
                    count++;
                }

                count = 1;
                foreach (Quota item in evaluateTable.Attitude)
                {
                    SimpleForm sf = new SimpleForm();
                    sf.ID          = "SimpleForm_Attitude_" + count;
                    sf.ShowHeader  = false;
                    sf.ShowBorder  = true;
                    sf.BodyPadding = "5px";
                    FineUI.TextBox tb = new FineUI.TextBox();
                    tb.ID       = "TextBox_Attitude_" + count;
                    tb.Label    = "标题";
                    tb.Text     = item.Title;
                    tb.Readonly = true;
                    sf.Items.Add(tb);
                    FineUI.TextArea ta = new FineUI.TextArea();
                    ta.ID    = "TextArea_Attitude_" + count;
                    ta.Label = "内容";
                    ta.Text  = "优:" + item.Content[0]
                               + "良:" + item.Content[1]
                               + "中:" + item.Content[2]
                               + "差:" + item.Content[3];
                    ta.Readonly = true;
                    sf.Items.Add(ta);
                    Panel8.Items.Add(sf);
                    count++;
                }

                SimpleForm sf__reject = new SimpleForm();
                sf__reject.ID          = "SimpleForm_Reject";
                sf__reject.ShowBorder  = true;
                sf__reject.ShowHeader  = false;
                sf__reject.BodyPadding = "5px";
                TextArea ta1 = new TextArea();
                ta1.Label = "严重违反规章制度";
                ta1.Text  = "累计旷工3天以上的;\n严重失职,营私舞弊,给本单位造成3000元以上经济损失或者其它严重后果的;\n同时与其他用人单位建立劳动关系,对完成本单位工作任务造成严重影响,或者经本单位提出,拒不改正的;\n违背职业道德,行贿、受贿价值超过3000元以上的;\n被依法追究刑事责任的;";
                TextArea ta2 = new TextArea();
                ta2.Label    = "其他";
                ta2.Text     = evaluateTable.Reject[0].Content[0];
                ta1.Readonly = true;
                ta2.Readonly = true;
                sf__reject.Items.Add(ta1);
                sf__reject.Items.Add(ta2);
                Panel9.Items.Add(sf__reject);

                Label_Comment.Text = evaluateTable.Comment;
            }
            else
            {
                Alert.ShowInTop("未查寻到考核表!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// 载入考核表
        /// </summary>
        private void loadEvaluateTable(string id)
        {
            string evaluatedID = "";

            if (id == "" || id == "0")
            {
                evaluatedID = Request.QueryString["id"];
            }
            else
            {
                evaluatedID = id;
            }
            Panel1.Title = Request.QueryString["name"] + "的考核表";
            EvaluateTable evaluateTable = new EvaluateTable();
            string        exception     = "";

            if (EvaluateTableManagementCtrl.GetEvaluateTable(evaluatedID, ref evaluateTable, ref exception))
            {
                Label_Comment.Text = evaluateTable.Comment;

                Label_EvaluatedName.Text = evaluateTable.EvaluatedName;
                Label_PostName.Text      = evaluateTable.PostName;
                Label_LaborDep.Text      = evaluateTable.LaborDep;
                Label_LaborUnit.Text     = evaluateTable.LaborUnit;
                Label_Period.Text        = evaluateTable.StartTime + " ~ " + evaluateTable.StopTime;

                for (int i = 0; i < evaluateTable.KeyResponse.Count; i++)
                {
                    SimpleForm sf = Panel3.Items[i] as SimpleForm;
                    sf.Collapsed = false;
                    TriggerBox         tb = sf.Items[0] as TriggerBox;
                    TextArea           ta = sf.Items[1] as TextArea;
                    FineUI.HiddenField hf = sf.Items[2] as FineUI.HiddenField;
                    tb.Text = evaluateTable.KeyResponse[i].Title;
                    ta.Text = evaluateTable.KeyResponse[i].Content[0];
                    hf.Text = evaluateTable.KeyResponse[i].Title + "&" + evaluateTable.KeyResponse[i].Content[0];
                }

                for (int i = 0; i < evaluateTable.KeyQualify.Count; i++)
                {
                    SimpleForm sf = Panel4.Items[i] as SimpleForm;
                    sf.Collapsed = false;
                    TriggerBox tb = sf.Items[0] as TriggerBox;
                    TextArea   ta = sf.Items[1] as TextArea;
                    tb.Text = evaluateTable.KeyQualify[i].Title;
                    ta.Text = "优:" + evaluateTable.KeyQualify[i].Content[0]
                              + " 良:" + evaluateTable.KeyQualify[i].Content[1]
                              + " 中:" + evaluateTable.KeyQualify[i].Content[2]
                              + " 差:" + evaluateTable.KeyQualify[i].Content[3];

                    FineUI.HiddenField hf = sf.Items[2] as FineUI.HiddenField;
                    hf.Text = evaluateTable.KeyQualify[i].Title
                              + "&" + evaluateTable.KeyQualify[i].Content[0]
                              + "^" + evaluateTable.KeyQualify[i].Content[1]
                              + "^" + evaluateTable.KeyQualify[i].Content[2]
                              + "^" + evaluateTable.KeyQualify[i].Content[3];
                }

                for (int i = 0; i < evaluateTable.KeyAttitude.Count; i++)
                {
                    SimpleForm sf = Panel5.Items[i] as SimpleForm;
                    sf.Collapsed = false;
                    TriggerBox tb = sf.Items[0] as TriggerBox;
                    TextArea   ta = sf.Items[1] as TextArea;
                    tb.Text = evaluateTable.KeyAttitude[i].Title;
                    ta.Text = "优:" + evaluateTable.KeyAttitude[i].Content[0]
                              + " 良:" + evaluateTable.KeyAttitude[i].Content[1]
                              + " 中:" + evaluateTable.KeyAttitude[i].Content[2]
                              + " 差:" + evaluateTable.KeyAttitude[i].Content[3];

                    FineUI.HiddenField hf = sf.Items[2] as FineUI.HiddenField;
                    hf.Text = evaluateTable.KeyAttitude[i].Title
                              + "&" + evaluateTable.KeyAttitude[i].Content[0]
                              + "^" + evaluateTable.KeyAttitude[i].Content[1]
                              + "^" + evaluateTable.KeyAttitude[i].Content[2]
                              + "^" + evaluateTable.KeyAttitude[i].Content[3];
                }

                for (int i = 0; i < evaluateTable.Response.Count; i++)
                {
                    SimpleForm sf = Panel6.Items[i] as SimpleForm;
                    sf.Collapsed = false;
                    TriggerBox         tb = sf.Items[0] as TriggerBox;
                    TextArea           ta = sf.Items[1] as TextArea;
                    FineUI.HiddenField hf = sf.Items[2] as FineUI.HiddenField;
                    tb.Text = evaluateTable.Response[i].Title;
                    ta.Text = evaluateTable.Response[i].Content[0];
                    hf.Text = evaluateTable.Response[i].Title + "&" + evaluateTable.Response[i].Content[0];
                }

                for (int i = 0; i < evaluateTable.Qualify.Count; i++)
                {
                    SimpleForm sf = Panel7.Items[i] as SimpleForm;
                    sf.Collapsed = false;
                    TriggerBox tb = sf.Items[0] as TriggerBox;
                    TextArea   ta = sf.Items[1] as TextArea;
                    tb.Text = evaluateTable.Qualify[i].Title;
                    ta.Text = "优:" + evaluateTable.Qualify[i].Content[0]
                              + " 良:" + evaluateTable.Qualify[i].Content[1]
                              + " 中:" + evaluateTable.Qualify[i].Content[2]
                              + " 差:" + evaluateTable.Qualify[i].Content[3];

                    FineUI.HiddenField hf = sf.Items[2] as FineUI.HiddenField;
                    hf.Text = evaluateTable.Qualify[i].Title
                              + "&" + evaluateTable.Qualify[i].Content[0]
                              + "^" + evaluateTable.Qualify[i].Content[1]
                              + "^" + evaluateTable.Qualify[i].Content[2]
                              + "^" + evaluateTable.Qualify[i].Content[3];
                }

                for (int i = 0; i < evaluateTable.Attitude.Count; i++)
                {
                    SimpleForm sf = Panel8.Items[i] as SimpleForm;
                    sf.Collapsed = false;
                    TriggerBox tb = sf.Items[0] as TriggerBox;
                    TextArea   ta = sf.Items[1] as TextArea;
                    tb.Text = evaluateTable.Attitude[i].Title;
                    ta.Text = "优:" + evaluateTable.Attitude[i].Content[0]
                              + " 良:" + evaluateTable.Attitude[i].Content[1]
                              + " 中:" + evaluateTable.Attitude[i].Content[2]
                              + " 差:" + evaluateTable.Attitude[i].Content[3];

                    FineUI.HiddenField hf = sf.Items[2] as FineUI.HiddenField;
                    hf.Text = evaluateTable.Attitude[i].Title
                              + "&" + evaluateTable.Attitude[i].Content[0]
                              + "^" + evaluateTable.Attitude[i].Content[1]
                              + "^" + evaluateTable.Attitude[i].Content[2]
                              + "^" + evaluateTable.Attitude[i].Content[3];
                }

                TextArea_Reject1.Text = "累计旷工3天以上的;\n严重失职,营私舞弊,给本单位造成3000元以上经济损失或者其它严重后果的;\n同时与其他用人单位建立劳动关系,对完成本单位工作任务造成严重影响,或者经本单位提出,拒不改正的;\n违背职业道德,行贿、受贿价值超过3000元以上的;\n被依法追究刑事责任的;";
                TextArea_Reject2.Text = evaluateTable.Reject[0].Content[0];
            }
            else    //如果该被考评人的岗位责任书尚未制定,则被考评人姓名、岗位名称、用工部门、用工单位和考核时间段从父网页获取
            {
                Label_EvaluatedName.Text = Request.QueryString["name"];
                Label_PostName.Text      = Request.QueryString["postname"];
                Label_LaborDep.Text      = Request.QueryString["labordepart"];
                Label_LaborUnit.Text     = Request.QueryString["depart"];
                Label_Period.Text        = Request.QueryString["starttime"] + " ~ " + Request.QueryString["stoptime"];
                TextArea_Reject1.Text    = "累计旷工3天以上的;\n严重失职,营私舞弊,给本单位造成3000元以上经济损失或者其它严重后果的;\n同时与其他用人单位建立劳动关系,对完成本单位工作任务造成严重影响,或者经本单位提出,拒不改正的;\n违背职业道德,行贿、受贿价值超过3000元以上的;\n被依法追究刑事责任的;";
            }
        }