Esempio n. 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;
                }
            }
        }
Esempio n. 2
0
        private void OnReAssignInvestigation_Invoked(object sender, ExternalDataEventArgs e)
        {
            InvestigationRequiredEventArgs args = (InvestigationRequiredEventArgs)e;
            Guid EmployeeId = (Guid)IgrssAdapters.EmployeeMaster.GetEmployeeIdByUsername(args.InvestigatingOfficer);

            IgrssAdapters.ComplainAdapter.AssignEnquiryOfficer(EmployeeId, DateTime.Now, ComplainId);
            string curUser = Thread.CurrentPrincipal.Identity.Name;

            string link = WorkflowLinks.Default.ComplainInvestigationResult;
            Dictionary <string, object> InfoList = new Dictionary <string, object>();

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

            WorkflowSupport.SendAlert(curUser, args.InvestigatingOfficer, link, "Complain Investigation Required!", InfoList, GroupId);
        }
Esempio n. 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));
            }
        }
Esempio n. 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));
            }
        }
Esempio n. 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);
        }
Esempio n. 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));
            }
        }
Esempio n. 7
0
        private void OnInvestigationRequired_Invoked(object sender, ExternalDataEventArgs e)
        {
            FeedbackData CurFeedback = AcceptanceList[0];

            InvestigationRequiredEventArgs args = (InvestigationRequiredEventArgs)e;
            Guid EmployeeId = (Guid)IgrssAdapters.EmployeeMaster.GetEmployeeIdByUsername(args.InvestigatingOfficer);

            IgrssAdapters.ComplainAdapter.AssignEnquiryOfficer(EmployeeId, DateTime.Now, ComplainId);
            string curUser = Thread.CurrentPrincipal.Identity.Name;

            string link = WorkflowLinks.Default.ComplainInvestigationResult;
            Dictionary <string, object> InfoList = new Dictionary <string, object>();

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

            WorkflowSupport.SendAlert(curUser, args.InvestigatingOfficer, link, "Complain Investigation Required for: " + FileNumber, InfoList, GroupId);

            WorkflowSupport.DeleteAlerts(CurFeedback.Alerts.ToArray());
        }
Esempio n. 8
0
        public static bool ReturnFile(Guid FileId)
        {
            string curUser = Thread.CurrentPrincipal.Identity.Name;
            string message = "File has been returned to you";

            int fileForwardLevel = Convert.ToInt32(IgrssAdapters.FileForwardingAdapter.GetFileForwardLevel(FileId));

            try
            {
                FileForwardTable ForwardDetail = IgrssAdapters.FileForwardingAdapter.GetFileForwardDetailsByLevel(FileId, fileForwardLevel);
                if (ForwardDetail.Rows.Count > 0)
                {
                    FileForwardsRow row   = ForwardDetail[0];
                    IgrssAlert      Alert = WorkflowSupport.GetAlertById(row.FordwardedAlertId);
                    if (fileForwardLevel > 1)
                    {
                        Guid GroupId = Guid.NewGuid();
                        WorkflowSupport.SendAlert(curUser, Alert.SentBy, Alert.Link, message, Alert.SessionData, GroupId);
                    }
                    else if (fileForwardLevel == 1)
                    {
                        WorkflowSupport.EnableAlert(Alert.AlertId);
                    }
                    WorkflowSupport.DeleteAlert(Alert.AlertId);
                    IgrssAdapters.FileForwardingAdapter.SetFileReturned(FileId, fileForwardLevel);
                }
                return(true);
            }
            catch (Exception ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DAL"))
                {
                    throw;
                }
            }
            return(false);
        }
Esempio n. 9
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));
                }
            }
        }