示例#1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strPfids   = string.Empty;
            string strPfnames = string.Empty;

            foreach (GridViewRow gvrow in gvChannel.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strPfids   += this.gvChannel.DataKeys[gvrow.RowIndex]["Cn_id"].ToString() + "|";
                    strPfnames += this.gvChannel.DataKeys[gvrow.RowIndex]["Cn_channelId"].ToString() + ",";
                }
            }
            if (strPfids == "" && strPfids.Length == 0)
            {
                //Jswork.Alert("请至少选择一条记录进行删除", this.Page);

                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 (channelMessage.Del(strPfids.Split('|')[i]) > 0)
                {
                    InsertLog(Resources.Resource.Delete_channel, string.Format("Cn_name:{0},Cn_id:{1}", strPfnames.Split(',')[i], strPfids.Split('|')[i]), -5, GetPlatformIdByValue(1));
                    iSuccess += 1;
                }
            }

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

                this.BindChannel();
            }
        }