public void BindNotepadType() { try { BAContactNote objBANote = new BAContactNote(); int NotePadId = 0; DataSet ds = objBANote.GetContactNote(NotePadId); if (ds.Tables[0].Rows.Count > 0) { dropNoteType.DataSource = ds.Tables[0]; dropNoteType.DataTextField = "NpName"; dropNoteType.DataValueField = "NotePadId"; dropNoteType.DataBind(); dropNoteType.Items.Insert(0, new ListItem("-- Please Select --", "0")); } else { dropNoteType.DataSource = null; dropNoteType.DataBind(); dropNoteType.Items.Insert(0, new ListItem("-- Please Select --", "0")); } } catch (Exception ex) { lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }
private void BindContactNote() { try { gvConNoteList.PageSize = int.Parse(ViewState["ps"].ToString()); int NotePadId = 0; DataSet ds = objBANote.GetContactNote(NotePadId); Session["dt"] = ds.Tables[0]; if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gvConNoteList.DataSource = ds.Tables[0]; string sortDirection = "ASC", sortExpression; if (ViewState["so"] != null) { sortDirection = ViewState["so"].ToString(); } if (ViewState["se"] != null) { sortExpression = ViewState["se"].ToString(); ds.Tables[0].DefaultView.Sort = sortExpression + " " + sortDirection; } gvConNoteList.DataBind(); } else { gvConNoteList.DataSource = null; gvConNoteList.DataBind(); Label lblEmptyMessage = gvConNoteList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label; lblEmptyMessage.Text = "Currently there are no records in System"; } } catch (Exception ex) { lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }
private void GetContactNote(int NotePadId) { try { DataSet ds = objBANote.GetContactNote(NotePadId); if (ds.Tables[0].Rows.Count > 0) { hf_ContactNoteId.Value = ds.Tables[0].Rows[0]["NotePadId"].ToString(); txtNoteKey.Text = ds.Tables[0].Rows[0]["NoteKey"].ToString(); txtNoteKey.Enabled = false; txtNoteDescription.Text = ds.Tables[0].Rows[0]["NpName"].ToString(); chkNoteDeactivate.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Deactivate"]); txtHelpText.Text = ds.Tables[0].Rows[0]["HelpText"].ToString(); ChkAppClients.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["AppToClients"]); ChkAppPrincipals.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["AppToPrincipals"]); } } catch (Exception ex) { lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }