Ejemplo n.º 1
0
        private void bindSecondsToGrid()
        {
            DataTable table     = new DataTable();
            string    exception = "";

            if (MessagePlatformManagementCtrl.GetSeconds(ref table, ref exception))
            {
                Grid1.DataSource = table;
                Grid1.DataBind();
            }
            else
            {
                table.Clear();
                Grid1.DataSource = table;
                Grid1.DataBind();
            }
        }
        /// <summary>
        /// 绑定考评人信息到Grid
        /// </summary>
        private void bindEvaluatorsToGrid()
        {
            DataTable table     = new DataTable();
            string    exception = "";

            if (DropDownList1.SelectedValue == "所有部门")
            {
                if (MessagePlatformManagementCtrl.GetEvaluators(ref table, ref exception))
                {
                    table            = dataTableFilter(table);
                    Grid1.DataSource = table;
                    Grid1.DataBind();
                }
                else
                {
                    table.Clear();
                    Grid1.DataSource = table;
                    Grid1.DataBind();
                    //Alert.ShowInTop("获取考评人信息失败!\n原因:" + exception, MessageBoxIcon.Error);
                }
            }
            else
            {
                string depart = DropDownList1.SelectedValue;
                if (MessagePlatformManagementCtrl.GetEvaluatorsByDepart(ref table, depart, ref exception))
                {
                    table            = dataTableFilter(table);
                    Grid1.DataSource = table;
                    Grid1.DataBind();
                }
                else
                {
                    table.Clear();
                    Grid1.DataSource = table;
                    Grid1.DataBind();
                    //Alert.ShowInTop("获取考评人信息失败!\n原因:" + exception, MessageBoxIcon.Error);
                }
            }
        }
        protected void Button_Send_Click(object sender, EventArgs e)
        {
            SyncSelectedRowIndexArrayToHiddenField();
            List <string> ids = (new JavaScriptSerializer()).Deserialize <List <string> >(hfSelectedIDS.Text.Trim());

            if (ids.Count == 0)
            {
                Alert.ShowInTop("请至少选择一项!", MessageBoxIcon.Warning);
                return;
            }

            string exception = "";
            string message   = TextArea_Message.Text;

            if (MessagePlatformManagementCtrl.SendMessageToEvaluators(ids, message, ref exception))
            {
                Alert.ShowInTop("发送成功!", MessageBoxIcon.Information);
            }
            else
            {
                Alert.ShowInTop("发送失败!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }