Пример #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strID = "";

        txtMessage.Text = ObjccWeb.fReplaceChars(txtMessage.Text);
        for (int i = 0; i < gvDetails.Rows.Count; i++)
        {
            if (((CheckBox)gvDetails.Rows[i].Cells[0].FindControl("ChbSelect")).Checked == true)
            {
                strID = strID + gvDetails.Rows[i].Cells[1].Text.Trim() + ",";
            }
        }

        if (strID != "")
        {
            strID = strID.Remove(strID.Length - 1);

            if (ddlSelect.SelectedValue == "D")
            {
                //if (ObjccWeb.ReturnSingleValue("select distinct status from MessageSendDetails where MessageID in (" + strID + ")") == "S")
                //{
                //    ObjccWeb.ExecuteQuery("DELETE FROM MessageSendDetails where MessageID in (" + strID + ")");
                //}
                //else
                //{
                //    ObjccWeb.ExecuteQuery("Update MessageSendDetails set Status='D' where MessageID in (" + strID + ")");
                //}
            }

            if (ddlSelect.SelectedValue == "S")
            {
                //   ObjccWeb.ExecuteQuery("Update MessageSendDetails set Status='S' where MessageID in (" + strID + ")");
            }
            if (ddlSelect.SelectedValue == "UR")
            {
                //  ObjccWeb.ExecuteQuery("Update MessageSendDetails set ReadUnread='UR' where MessageID in (" + strID + ")");
            }
            if (ddlSelect.SelectedValue == "R")
            {
                //ObjccWeb.ExecuteQuery("Update MessageSendDetails set ReadUnread='R' where MessageID in (" + strID + ")");
            }

            if (ddlSelect.SelectedValue == "I")
            {
                // ObjccWeb.ExecuteQuery("Update MessageSendDetails set Status='' where MessageID in (" + strID + ")");
            }
        }
        gvDetails.DataSource = ObjccWeb.BindDataSet(" Exec SpMessageBind  " + Session["UID"] + ",'I'");
        gvDetails.DataBind();
        HidType.Value = "I";
    }