Пример #1
0
        protected void wdgNotes_ItemCommand(object sender, Infragistics.Web.UI.GridControls.HandleCommandEventArgs e)
        {
            int        policyNoteID = 0;
            PolicyNote note         = null;

            if (e.CommandName == "DoEdit")
            {
                policyNoteID = Convert.ToInt32(e.CommandArgument);
                using (PolicyNoteManager repository = new PolicyNoteManager()) {
                    note = repository.Get(policyNoteID);

                    pnlPolicyNoteEdit.Visible = true;
                    pnlPolicyNotes.Visible    = false;

                    txtPolicyNote.Text = note.Notes;
                }
                ViewState["policyNoteID"] = policyNoteID.ToString();
            }
            else if (e.CommandName == "DoRemove")
            {
                policyNoteID = Convert.ToInt32(e.CommandArgument);

                using (PolicyNoteManager repository = new PolicyNoteManager()) {
                    note = repository.Get(policyNoteID);
                    repository.Delete(note);

                    btnPolicyNoteCancel_Click(null, null);
                }
            }
        }
Пример #2
0
        protected void wdgContacts_ItemCommand(object sender, Infragistics.Web.UI.GridControls.HandleCommandEventArgs e)
        {
            ClaimContact claimContact = null;

            int contactID = 0;
            int claimID   = SessionHelper.getClaimID();

            if (e.CommandName == "DoImport")
            {
                try {
                    contactID              = Convert.ToInt32(e.CommandArgument);
                    claimContact           = new ClaimContact();
                    claimContact.ClaimID   = claimID;
                    claimContact.ContactID = contactID;

                    ClaimContactManager.Save(claimContact);

                    lblImportContactMessage.Text     = "Contact was imported successfully.";
                    lblImportContactMessage.CssClass = "ok";
                }
                catch (Exception ex) {
                    Core.EmailHelper.emailError(ex);
                    lblImportContactMessage.Text     = "Contact was not imported.";
                    lblImportContactMessage.CssClass = "error";
                }
            }
        }
Пример #3
0
        protected void gvTasks_ItemCommand(object sender, Infragistics.Web.UI.GridControls.HandleCommandEventArgs e)
        {
            string[] taskID_TaskType = null;
            string   encrypedID      = null;
            int      taskID          = 0;

            if (e.CommandName == "DoEdit")
            {
                taskID_TaskType = e.CommandArgument.ToString().Split('|');

                encrypedID = SecurityManager.EncryptQueryString(taskID_TaskType[0]);

                if (taskID_TaskType[1] == "1")
                {
                    Response.Redirect("~/protected/TaskEdit.aspx?q=" + encrypedID);
                }
                else if (taskID_TaskType[1] == "2")
                {
                    Response.Redirect("~/protected/EventEdit.aspx?q=" + encrypedID);
                }
            }
            else if (e.CommandName == "DoDelete")
            {
                taskID = Convert.ToInt32(e.CommandArgument);
                TasksManager.Delete(taskID);
                Response.Redirect(Request.RawUrl);
            }
        }