Exemplo n.º 1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strPfids   = string.Empty;
            string strPfnames = string.Empty;

            foreach (GridViewRow gvrow in gvGame.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strPfids   += this.gvGame.DataKeys[gvrow.RowIndex]["Gm_gameId"].ToString() + "|";
                    strPfnames += this.gvGame.DataKeys[gvrow.RowIndex]["Gm_name"].ToString() + ",";
                }
            }
            if (strPfids == "" && strPfids.Length == 0)
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.tip_only_delete; //"请至少选择一条记录进行删除";

                return;
            }

            strPfids = strPfids.TrimEnd('|');

            NxPlatformMO pmMO = new NxPlatformMO();

            int iSuccess = 0;

            for (int i = 0; i < strPfids.Split('|').Length; i++)
            {
                if (gameMessage.Del(strPfids.Split('|')[i]) > 0)
                {
                    InsertLog(Resources.Resource.Delete_game, string.Format("Gm_gameId:{0},Gm_name:{1}", strPfnames.Split(',')[i], strPfids.Split('|')[i]), 5011, GetPlatformIdByValue(1));
                    iSuccess += 1;
                }
            }

            if (iSuccess > 0)
            {
                Jswork.Alert(Resources.Resource.tip_delete_success, this.Page);

                this.BindGame();
            }
        }