private void GetNotes() { try { objProjectCls = new ProjectClass(); string sProjId = (string)(Session["projId"]); string sLogisticCompany = objProjectCls.GetLogisticCompany(sProjId); objProjectCls.NotesHandle = "T_ERECTIONACTIVITY_" + sLogisticCompany + ""; objProjectCls.AttachmentHandle = "T_ERECTIONACTIVITY_" + sLogisticCompany + ""; objProjectCls.IndexValue = hdfNoteId.Value; //DataTable dt = objProjectCls.GetNotesFromASPNETUSer(); DataTable dt = objProjectCls.GetNotes(); if (dt.Rows.Count > 0) { rptNotes.DataSource = dt; rptNotes.DataBind(); } else { //ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "alert('No record found');", true); } // DataTable dtAttach = objProjectCls.GetAllAttachments(); DataTable dtAttach = objProjectCls.GetAttachments(); if (dtAttach.Rows.Count > 0) { gvAttachment.DataSource = dtAttach; gvAttachment.DataBind(); divNoRecord.Visible = false; divViewAttachment.Visible = true; } else { divNoRecord.Visible = true; divViewAttachment.Visible = false; } } catch (Exception ex) { } }
private void BindData() { try { DataTable dt = new DataTable(); string sUsername = (string)(Session["Username"]); // sUsername = "******";// for testing only //if (Request.QueryString["user"] != null) if (sUsername != null) { objProjectCls = new ProjectClass(); string sProjId = (string)(Session["projId"]); string sLogisticCompany = objProjectCls.GetLogisticCompany(sProjId); objProjectCls.IndexValue = hdfNoteId.Value; objProjectCls.AttachmentHandle = "T_ERECTIONACTIVITY_" + sLogisticCompany + ""; dt = objProjectCls.GetAttachments(); if (dt.Rows.Count > 0) { gvAttachment.DataSource = dt; gvAttachment.DataBind(); divNoRecord.Visible = false; divViewAttachment.Visible = true; } else { divNoRecord.Visible = true; divViewAttachment.Visible = false; } } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "alert('No Data found');", true); } } catch (System.Exception ex) { ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "alert('Due to some technical issue record not found');", true); } }