protected void FillFileAttachDetail()
    {
        //dt = new DataTable();
        //Int32 MsgId;
        //MsgId = 0;
        //DataTable dtMain = new DataTable();
        //Int32 MsgDetailId = Convert.ToInt32(Request.QueryString["MsgDetailId"]);
        //dt = clsMessage.SelectMsgIdUsingMsgDetailId(MsgDetailId);
        //// if (dt.Rows.Count > 0)
        //// {
        //// MsgId = Convert.ToInt32(Request.QueryString["MsgId"]);
        //if (dt.Rows.Count > 0)
        //{
        Int32 MsgId = Convert.ToInt32(Request.QueryString["MsgId"]);

        dt = new DataTable();
        dt = clsMessage.SelectMsgforFileAttach(MsgId);
        if (dt.Rows.Count > 0)
        {
            GrdFileList.DataSource = dt;
            GrdFileList.DataBind();
            lblAttachment.Visible = false;
            setGridisze();
        }
        //  }
        else
        {
            lblAttachment.Visible = true;
        }
        // }
    }
    protected void FillFileAttachDetail()
    {
        dt = new DataTable();
        Int32 MsgId;

        MsgId = 0;
        DataTable dtMain      = new DataTable();
        Int32     MsgDetailId = Convert.ToInt32(Request.QueryString["MsgDetailId"]);

        dt = clsMessage.SelectMsgIdUsingMsgDetailId(MsgDetailId);
        if (dt.Rows.Count > 0)
        {
            MsgId = Convert.ToInt32(dt.Rows[0]["MsgId"].ToString());
            dt    = new DataTable();
            dt    = clsMessage.SelectMsgforFileAttach(MsgId);
            if (dt.Rows.Count > 0)
            {
                GrdFileList.DataSource = dt;
                GrdFileList.DataBind();
                //   DataList1.DataSource = dt;
                // DataList1.DataBind();
                setGridisze();
            }
        }
    }
예제 #3
0
 protected void gridInbox_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         ////
         if (DataBinder.Eval(e.Row.DataItem, "MsgStatusName").ToString() == "UNREAD")
         {
             e.Row.Cells[5].ForeColor = System.Drawing.Color.Red;
             e.Row.Cells[5].Font.Bold = true;
         }
         Int32     MsgId       = 0;
         DataTable dtMain      = new DataTable();
         Int32     MsgDetailId = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "MsgDetailId").ToString());
         dtMain = clsMessage.SelectMsgIdUsingMsgDetailId(MsgDetailId);
         if (dtMain.Rows.Count > 0)
         {
             MsgId  = Convert.ToInt32(dtMain.Rows[0]["MsgId"].ToString());
             dtMain = new DataTable();
             dtMain = clsMessage.SelectMsgforFileAttach(MsgId);
             Image img = (Image)e.Row.FindControl("ImgFile");
             if (dtMain.Rows.Count > 0)
             {
                 img.ImageUrl = "~/Account/images/attach.png";
                 img.Visible  = true;
             }
             else
             {
                 img.ImageUrl = "";
                 img.Visible  = false;
             }
         }
     }
     try
     {
         if (gridInbox.Rows.Count > 0)
         {
             CheckBox cbHeader = (CheckBox)gridInbox.HeaderRow.FindControl("HeaderChkbox");
             cbHeader.Attributes["onclick"] = "ChangeAllCheckBoxStates(this.checked);";
             List <string> ArrayValues = new List <string>();
             ArrayValues.Add(string.Concat("'", cbHeader.ClientID, "'"));
             foreach (GridViewRow gvr in gridInbox.Rows)
             {
                 CheckBox cb = (CheckBox)gvr.FindControl("chkMsg");
                 cb.Attributes["onclick"] = "ChangeHeaderAsNeeded();";
                 ArrayValues.Add(string.Concat("'", cb.ClientID, "'"));
             }
             CheckBoxIDsArray.Text = "<script type='text/javascript'>" + "\n" + "<!--" + "\n" + String.Concat("var CheckBoxIDs =  new Array(", String.Join(",", ArrayValues.ToArray()), ");") + "\n // -->" + "\n" + "</script>";
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         pnlmsg.Visible = true;
         lblmsg.Text    = "Error in databound : " + ex.Message.ToString();
     }
 }
예제 #4
0
    protected void gridDraft_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Int32     MsgId  = 0;
            DataTable dtMain = new DataTable();
            MsgId  = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "MsgId").ToString());
            dtMain = new DataTable();
            dtMain = clsMessage.SelectMsgDetailforDraftPartyList(MsgId);
            Label sentTo = (Label)e.Row.FindControl("lblSentTo");

            if (dtMain.Rows.Count > 0)
            {
                String ToList = "";
                int    i      = 0;
                foreach (DataRow DR in dtMain.Rows)
                {
                    if (i >= 1)
                    {
                        ToList = ToList + " , " + DR["Compname"].ToString();
                    }
                    if (i == 0)
                    {
                        ToList = DR["Compname"].ToString();
                        i      = 1;
                    }
                    if (ToList.Length > 25)
                    {
                        ToList = ToList + " ....";
                        break;
                    }
                }
                sentTo.Text = ToList.ToString();
            }
            dtMain = new DataTable();
            dtMain = clsMessage.SelectMsgforFileAttach(MsgId);
            Image img = (Image)e.Row.FindControl("ImgFile");


            if (dtMain.Rows.Count > 0)
            {
                img.ImageUrl = "~/Account/images/attach.png";
                img.Visible  = true;
            }
            else
            {
                img.ImageUrl = "";
                img.Visible  = false;
            }
        }
        try
        {
            if (gridDraft.Rows.Count > 0)
            {
                CheckBox cbHeader = (CheckBox)gridDraft.HeaderRow.FindControl("HeaderChkbox");
                cbHeader.Attributes["onclick"] = "ChangeAllCheckBoxStates(this.checked);";
                List <string> ArrayValues = new List <string>();
                ArrayValues.Add(string.Concat("'", cbHeader.ClientID, "'"));
                foreach (GridViewRow gvr in gridDraft.Rows)
                {
                    CheckBox cb = (CheckBox)gvr.FindControl("chkMsg");
                    cb.Attributes["onclick"] = "ChangeHeaderAsNeeded();";
                    ArrayValues.Add(string.Concat("'", cb.ClientID, "'"));
                }
                CheckBoxIDsArray.Text = "<script type='text/javascript'>" + "\n" + "<!--" + "\n" + String.Concat("var CheckBoxIDs =  new Array(", String.Join(",", ArrayValues.ToArray()), ");") + "\n // -->" + "\n" + "</script>";
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            pnlmsg.Visible = true;
            lblmsg.Text    = "Error in databound : " + ex.Message.ToString();
        }
    }