예제 #1
0
 /// <summary>
 /// 回复按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnReply_Click(object sender, EventArgs e)
 {
     if (dgvMsgInfoNew.Rows.Count > 0)
     {
         int inMark = 0;
         for (int i = 0; i < dgvMsgInfoNew.Rows.Count; i++)
         {
             if (dgvMsgInfoNew.Rows[i].Cells["select"].EditedFormattedValue.ToString() == "True")
             {
                 inMark = inMark + 1;
                 if (inMark > 1)
                 {
                     App.Msg("回复按钮只支持单条操作,不支持批量操作!");
                     return;
                 }
             }
         }
     }
     for (int j = 0; j < dgvMsgInfoNew.Rows.Count; j++)
     {
         if (dgvMsgInfoNew.Rows[j].Cells["select"].EditedFormattedValue.ToString() == "True")
         {
             string msgIds = "";
             if (dgvMsgInfoNew.Rows[j].Cells["回复"].Value.ToString() == "是")
             {
                 msgIds = dgvMsgInfoNew.Rows[j].Cells["id"].Value.ToString();
             }
             if (msgIds != "")
             {
                 frmMsgReplay frmR = new frmMsgReplay(msgIds);
                 frmR.ShowDialog();
                 if (frmR.flag)
                 {
                     GetMessage();
                 }
             }
             else
             {
                 App.Msg("请选择需要回复的消息进行操作!");
                 return;
             }
         }
     }
 }
예제 #2
0
        private void btnReply_Click(object sender, EventArgs e)
        {
            string msgIds = "";
            DataGridViewCheckBoxCell cell = dgvMsgInfoNew.CurrentRow.Cells["replay"] as DataGridViewCheckBoxCell;

            if (cell != null && cell.EditedFormattedValue.ToString() == "True")
            {
                msgIds = dgvMsgInfoNew.CurrentRow.Cells["id"].Value.ToString();
            }
            if (msgIds != "")
            {
                frmMsgReplay frmR = new frmMsgReplay(msgIds);
                frmR.ShowDialog();
                if (frmR.flag)
                {
                    GetMessage();
                }
            }
            else
            {
                App.Msg("请选择需要回复的消息!");
            }
        }
예제 #3
0
        private void btnReply_Click(object sender, EventArgs e)
        {
            List <string> sqls = new List <string>();

            if (dgvMsgInfoNew.Rows.Count > 0)
            {
                int strCount = 0;
                for (int i = 0; i < dgvMsgInfoNew.Rows.Count; i++)
                {
                    if (dgvMsgInfoNew.Rows[i].Cells["select"].EditedFormattedValue.ToString() == "True")
                    {
                        strCount = strCount + 1;
                        if (strCount > 1)
                        {
                            App.Msg("回复按钮只支持单条操作,不支持批量操作!");
                            return;
                        }
                    }
                }
            }
            for (int j = 0; j < dgvMsgInfoNew.Rows.Count; j++)
            {
                if (dgvMsgInfoNew.Rows[j].Cells["select"].EditedFormattedValue.ToString() == "True")
                {
                    string msgIds = "";
                    if (dgvMsgInfoNew.Rows[j].Cells["回复"].Value.ToString() == "是")
                    {
                        msgIds = dgvMsgInfoNew.Rows[j].Cells["id"].Value.ToString();
                    }
                    if (msgIds != "")
                    {
                        frmMsgReplay frmR = new frmMsgReplay(msgIds);
                        frmR.ShowDialog();
                        if (frmR.flag)
                        {
                            GetMessage();
                        }
                    }
                    else
                    {
                        App.Msg("请选择需要回复的消息进行操作!");
                        return;
                    }
                }
            }
            #region 注释掉
            //if (dgvMsgInfoNew.CurrentCell!=null)
            //{
            //    string msgIds = "";
            //    if (dgvMsgInfoNew.CurrentRow.Cells["回复"].Value.ToString() == "是")
            //    {
            //        msgIds = dgvMsgInfoNew.CurrentRow.Cells["id"].Value.ToString();
            //    }
            //    if (msgIds != "")
            //    {
            //        frmMsgReplay frmR = new frmMsgReplay(msgIds);
            //        frmR.ShowDialog();
            //        if (frmR.flag)
            //        {
            //            GetMessage();
            //        }
            //    }
            //    else
            //    {
            //        App.Msg("请选择需要回复的消息!");
            //    }
            //}
            #endregion
        }