protected void cbxPrint_CheckedChanged(object sender, EventArgs e) { ClaimDocument document = null; CheckBox cbx = sender as CheckBox; GridViewRow row = cbx.NamingContainer as GridViewRow; try { int documentID = (int)gvDocuments.DataKeys[row.RowIndex].Value; document = ClaimDocumentManager.Get(documentID); if (document != null) { document.IsPrint = cbx.Checked; document = ClaimDocumentManager.Save(document); bindData(this.claimID); } } catch (Exception ex) { Core.EmailHelper.emailError(ex); } }
protected void btnSaveDocumentEdit_Click(object sender, EventArgs e) { int claimDocumentID = Convert.ToInt32(ViewState["ClaimDocumentID"]); ClaimDocument claimDocument = null; Page.Validate("document"); if (!Page.IsValid) { return; } claimDocument = ClaimDocumentManager.Get(claimDocumentID); if (claimDocument != null) { claimDocument.Description = txtDcoumentDescription.Text.Trim(); if (ddlDocumentCategoryEdit.SelectedIndex > 0) { claimDocument.DocumentCategoryID = Convert.ToInt32(ddlDocumentCategoryEdit.SelectedValue); } ClaimDocumentManager.Save(claimDocument); } pnlEditClaimDocument.Visible = false; pnlGridPanel.Visible = true; gvDocuments.DataSource = ClaimDocumentManager.GetAll(this.claimID); gvDocuments.DataBind(); }
protected void gvDocuments_RowCommand(object sender, GridViewCommandEventArgs e) { int documentID = Convert.ToInt32(e.CommandArgument); ClaimDocument claimDocument = null; if (e.CommandName == "DoDelete") { try { ClaimDocumentManager.Delete(documentID); bindData(this.claimID); } catch (Exception ex) { Core.EmailHelper.emailError(ex); } } else if (e.CommandName == "DoEdit") { ViewState["ClaimDocumentID"] = e.CommandArgument.ToString(); claimDocument = ClaimDocumentManager.Get(documentID); if (claimDocument != null) { pnlEditClaimDocument.Visible = true; pnlGridPanel.Visible = false; txtDcoumentDescription.Text = claimDocument.Description; bindDocumentCategory(ddlDocumentCategoryEdit); ddlDocumentCategoryEdit.SelectedValue = (claimDocument.DocumentCategoryID ?? 0).ToString(); } } }