Esempio n. 1
0
    /// <summary>
    /// 获取俱乐部玩家列表
    /// </summary>
    /// <param name="call"></param>
    public void SendGetClubPlayerInfo()
    {
        CommonSendProto req = new CommonSendProto();

        NetProcess.SendRequest <CommonSendProto>(req, ProtoIdMap.CMD_SendGetClubUsers, (msg) =>
        {
            ClubPlayerInfoAck data = msg.Read <ClubPlayerInfoAck>();
            if (data.code == 1)
            {
                if (data.data != null)
                {
                    ClubModel.Inst.AllPlayerPeach = data.data.allPlayerPeach;
                }
                if (data.data != null && data.data.list != null)
                {
                    ClubModel.Inst.ClubPlayerInfoData = data.data.list;
                }
                ClubView view = Global.Inst.GetController <ClubController>().OpenWindow() as ClubView;
                view.SetData(ClubModel.Inst.mClubData);
            }
            else
            {
                GameUtils.ShowErrorTips(data.code);
            }
        });
    }
    private void Bind()
    {
        DataConnection myConnection = new DataConnection();
        String         script       = "Select RegNum, ClubName from Clubs";

        ClubView.DataSource   = myConnection.ExecuteScript(script);
        ClubView.DataKeyNames = new string[] { "RegNum" };
        ClubView.DataBind();
    }
Esempio n. 3
0
    public override BaseView OpenWindow()
    {
        BaseView view = base.OpenWindow();

        if (mView == null)
        {
            mView = view as ClubView;
        }
        return(view);
    }
Esempio n. 4
0
    private void BindGrid()
    {
        SqlDataAdapter adapter;
        SqlConnection  con = null;

        if (ViewState["TransferDataset"] == null)
        {
            try
            {
                String connectionString = ConfigurationManager.ConnectionStrings["Assignment3"].ConnectionString;
                String script           = "SELECT Players.PlayerName, Clubs.ClubName FROM Players INNER JOIN Clubs ON Players.ClubRegNum = Clubs.RegNum";
                con     = new SqlConnection(connectionString);
                adapter = new SqlDataAdapter(script, con);
                adapter.Fill(dataSet, "Result");

                adapter.SelectCommand.CommandText = "Select PlayerName,JerseyNumber,DOB,ClubRegNum  from Players";
                adapter.Fill(dataSet, "Players");
            }
            catch (Exception e)
            {
                throw e;
            }
            ViewState["TransferDataset"] = dataSet;
        }
        else
        {
            dataSet = (DataSet)ViewState["TransferDataset"];
        }
        String sortExpression;

        if (gridSortDirection == SortDirection.Ascending)
        {
            sortExpression = gridSortExpression + " ASC";
        }
        else
        {
            sortExpression = gridSortExpression + " DESC";
        }
        dataSet.Tables["Result"].DefaultView.Sort = sortExpression;

        ClubView.DataSource = dataSet.Tables["Result"];
        ClubView.DataBind();
    }