Exemplo n.º 1
0
        // 行事件
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                string keyname = Grid1.Rows[e.RowIndex].Values[1].ToString();
                int    flag    = operate.DeleteRecommendByTypeName(keyname);
                if (flag >= 1)
                {
                    Alert.ShowInParent("删除成功");
                    BindData();
                }
                else
                {
                    Alert.ShowInParent("删除失败");
                }
            }
            else if (e.CommandName == "CheckBox1")
            {
                string keyname = Grid1.Rows[e.RowIndex].Values[1].ToString();
                FineUI.CheckBoxField checkField = (FineUI.CheckBoxField)Grid1.FindColumn(e.ColumnIndex);
                bool checkState = checkField.GetCheckedState(e.RowIndex);

                int a = operate.UpdateRecommendByTypeName(keyname, checkState);
                if (a > 0)
                {
                    Alert.ShowInParent("操作成功");
                    BindData();
                }
                else
                {
                    Alert.ShowInParent("操作失败");
                }
            }
            else if (e.CommandName == "MoveUp")
            {
                int ID = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0].ToString());
                operate.GetRecommendByMove(ID, "上移");
                BindData();
            }
            else if (e.CommandName == "MoveDown")
            {
                int ID = Convert.ToInt32(Grid1.Rows[e.RowIndex].Values[0].ToString());
                operate.GetRecommendByMove(ID, "下移");
                BindData();
            }
        }