Example #1
0
        /// <summary>
        /// Forward the specified File to a particular Role in a Office
        /// </summary>
        /// <param name="FileId">Id of the file that has to be forwarded</param>
        /// <param name="Designation">Designation to whom the file has to be forwarded</param>
        /// <param name="OfficeId">Id of the Office where the file has to be forwarded</param>
        public static void ForwardFile(Guid FileId, Guid Designation, Guid OfficeId, Guid OriginalAlertId)
        {
            string curUser    = Thread.CurrentPrincipal.Identity.Name;
            string link       = "";
            string Department = "";
            Dictionary <string, object> InfoList = new Dictionary <string, object>();
            string FileNumber = GetFileNo(FileId);

            if (FileNumber != "")
            {
                Department = FileNumber.Substring(0, 3);
            }
            switch (Department)
            {
            case "LIC":
                link = "~/License/LicenseApplication.aspx?Mode=View";
                break;

            case "APL":
                link = "~/Appeal/AppealApplication.aspx?Mode=ReadOnly";
                break;

            case "COM":
                link = "~/Complain/Complaint.aspx?Mode=ReadOnly";
                break;

            case "REF":
                link = "~/Refund/RefundApplication.aspx?Mode=ReadOnly";
                break;

            case "ADJ":
                //InfoList.Add(ValuationFormId, FileId);
                link = "~/Adjudication/AdjApplication.aspx?Mode=ReadOnly";
                break;
            }

            InfoList.Add("FileId", FileId);
            string Message = "A File has been forwarded by:" + curUser;

            try
            {
                StringBuilder FwdUsers = new StringBuilder();
                Guid          GroupId  = Guid.NewGuid();
                foreach (string AlertUser in WorkflowSupport.GetUserAtOfficeRole(OfficeId, Designation))
                {
                    WorkflowSupport.SendAlert(curUser, AlertUser, link, Message, InfoList, GroupId);
                    FwdUsers.Append(AlertUser + ", ");
                }
                string forwardedTo = FwdUsers.ToString().Remove(FwdUsers.ToString().Length - 2);
                IgrssAdapters.FileForwardingAdapter.AddFileForwardDetails(FileId, curUser, forwardedTo, DateTime.Now, OriginalAlertId);
                WorkflowSupport.DisableAlert(OriginalAlertId);
            }
            catch (Exception ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DAL"))
                {
                    throw;
                }
            }
        }
 protected void FvAssignOfficer_ItemCommand(object sender, FormViewCommandEventArgs e)
 {
     if (e.CommandName == "AssignOfficer")
     {
         Complain     cmp       = new Complain();
         DropDownList ddlOffice = (DropDownList)FvAssignOfficer.FindControl("ddlOfficeName");
         DropDownList ddlDesig  = (DropDownList)FvAssignOfficer.FindControl("ddlDesigination");
         string[]     officer   = WorkflowSupport.GetUserAtOfficeRole(new Guid(ddlOffice.SelectedValue), new Guid(ddlDesig.SelectedValue));
         cmp.AssignEnquiryOfficer(officer[0], new Guid(fldComplainId.Value));
         Response.Redirect("~/");
     }
 }
Example #3
0
        private void OnFileClosed_Invoked(object sender, ExternalDataEventArgs e)
        {
            string curUser = Thread.CurrentPrincipal.Identity.Name;
            // Complain File has been closed alert the Officer who accepted the Complain
            FeedbackData CurFeedback             = AcceptanceList[0];
            Guid         OfficeId                = CurFeedback.ForwardingOffice;
            Guid         RoleId                  = CurFeedback.Role; // new Guid("9c83ade7-74ce-448e-b57c-3f6c5a4a5569");
            string       link                    = WorkflowLinks.Default.ComplainInvestigationResult;
            Dictionary <string, object> InfoList = new Dictionary <string, object>();

            InfoList.Add("FileId", ComplainId);
            Guid GroupId = Guid.NewGuid();

            foreach (string AlertUser in WorkflowSupport.GetUserAtOfficeRole(OfficeId, RoleId))
            {
                CurFeedback.Alerts.Add(WorkflowSupport.SendAlert(curUser, AlertUser, link, "Complain Investigation Complete...", InfoList, GroupId));
            }
        }
Example #4
0
        private void ApprovalAlert_ExecuteCode(object sender, System.EventArgs e)
        {
            string       curUser                 = Thread.CurrentPrincipal.Identity.Name;
            FeedbackData CurFeedback             = ApprovalList[approvalIndex];
            Guid         OfficeId                = CurFeedback.ForwardingOffice;
            Guid         RoleId                  = CurFeedback.Role; // new Guid("9c83ade7-74ce-448e-b57c-3f6c5a4a5569");
            string       link                    = WorkflowLinks.Default.RefundApproval;
            Dictionary <string, object> InfoList = new Dictionary <string, object>();

            InfoList.Add("FileId", RefundId);
            FileManagement flmgmt     = new FileManagement();
            string         FileNumber = flmgmt.GetFileNumberByFileId(RefundId);
            Guid           GroupId    = Guid.NewGuid();

            foreach (string AlertUser in WorkflowSupport.GetUserAtOfficeRole(OfficeId, RoleId))
            {
                CurFeedback.Alerts.Add(WorkflowSupport.SendAlert(curUser, AlertUser, link, "Refund Approval Pending for: " + FileNumber, InfoList, GroupId));
            }
        }
Example #5
0
        static void SendAlert()
        {
            Guid OfficeId = new Guid("c53112ee-5868-43aa-bcf5-52454f589daa");
            Guid RoleId   = new Guid("7c83e591-a861-4b4f-bd1d-12f99cc32123");

            string[] usersToAlert = WorkflowSupport.GetUserAtOfficeRole(OfficeId, RoleId);

            Dictionary <string, object> InfoList = new Dictionary <string, object>();

            InfoList.Add("item1", Guid.NewGuid());
            InfoList.Add("item2", Convert.ToInt32("568"));
            XmlDocument doc = new XmlDocument();

            doc = WorkflowSupport.SerilizeDictionary(InfoList);
            foreach (string user in usersToAlert)
            {
                WorkflowSupport.SendAlert("admin", user, "link", "Test Message", doc);
            }
            Dictionary <string, object> AlertsInfo = new Dictionary <string, object>();

            AlertsInfo = WorkflowSupport.DeSerilizeDictionary(doc);
        }
Example #6
0
        private void OnInvestigationDone_Invoked(object sender, ExternalDataEventArgs e)
        {
            string curUser = Thread.CurrentPrincipal.Identity.Name;
            InvestigationDoneEventArgs args = (InvestigationDoneEventArgs)e;

            IgrssAdapters.InvestigationAdapter.AddInvestigationDetail(Guid.NewGuid(), ComplainId, args.InvestigationDate, args.InvestigationDetails, curUser, DateTime.Now);

            // Investigation is Completed so alert the Officer who assigned the Investigation
            FeedbackData CurFeedback             = AcceptanceList[0];
            Guid         OfficeId                = CurFeedback.ForwardingOffice;
            Guid         RoleId                  = CurFeedback.Role; // new Guid("9c83ade7-74ce-448e-b57c-3f6c5a4a5569");
            string       link                    = WorkflowLinks.Default.ComplainInvestigationResult;
            Dictionary <string, object> InfoList = new Dictionary <string, object>();

            InfoList.Add("FileId", ComplainId);
            Guid GroupId = Guid.NewGuid();

            foreach (string AlertUser in WorkflowSupport.GetUserAtOfficeRole(OfficeId, RoleId))
            {
                CurFeedback.Alerts.Add(WorkflowSupport.SendAlert(curUser, AlertUser, link, "Complain Investigation Complete...", InfoList, GroupId));
            }
        }
Example #7
0
        private void VerificationAlert_ExecuteCode(object sender, System.EventArgs e)
        {
            string       link        = "";
            string       curUser     = Thread.CurrentPrincipal.Identity.Name;
            FeedbackData CurFeedback = VerificationList[verificationIndex];
            Guid         OfficeId    = CurFeedback.ForwardingOffice;
            Guid         RoleId      = CurFeedback.Role; // new Guid("9c83ade7-74ce-448e-b57c-3f6c5a4a5569");
            bool         IsFranking  = FileManager.GetLicenseType(LicenseId);

            if (IsFranking == true)
            {
                link = WorkflowLinks.Default.FrankingMachineVerification;
            }
            else
            {
                link = WorkflowLinks.Default.LicenseVerification;
            }

            Dictionary <string, object> InfoList = new Dictionary <string, object>();

            InfoList.Add("FileId", LicenseId);
            FileManagement flmgmt     = new FileManagement();
            string         FileNumber = flmgmt.GetFileNumberByFileId(LicenseId);
            Guid           GroupId    = Guid.NewGuid();

            foreach (string AlertUser in WorkflowSupport.GetUserAtOfficeRole(OfficeId, RoleId))
            {
                if (IsFranking == true)
                {
                    CurFeedback.Alerts.Add(WorkflowSupport.SendAlert(curUser, AlertUser, link, "Franking License Verification Pending for: " + FileNumber, InfoList, GroupId));
                }
                else
                {
                    CurFeedback.Alerts.Add(WorkflowSupport.SendAlert(curUser, AlertUser, link, "License Verification Pending for: " + FileNumber, InfoList, GroupId));
                }
            }
        }