コード例 #1
0
        protected void FinalSubmitApplication(string usname, string refNoPrj)
        {
            try
            {
                var approvedyeah =
                    nav.myConsultations.ToList()
                    .Where(a => a.No == refNoPrj)
                    .Select(ast => ast.Approval_Status)
                    .SingleOrDefault();

                switch (approvedyeah)
                {
                case "Approved":
                    KCDFAlert.ShowAlert("You cannot Submit an Appproved application!!");
                    break;

                case "Declined":
                    KCDFAlert.ShowAlert("Your application was declined!, You cannot submit");
                    break;

                case "Open":
                    var credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"],
                                                            ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]);
                    Portals sup = new Portals();
                    sup.Credentials     = credentials;
                    sup.PreAuthenticate = true;
                    bool isSubmitted = sup.FnSubmitConsultApp(usname, refNoPrj);

                    switch (isSubmitted)
                    {
                    case true:
                        KCDFAlert.ShowAlert("Your Application is Successfully submitted!" + isSubmitted);
                        LoadmyApplications();
                        SendEmail(usname, refNoPrj);
                        Session.Remove("validOR");
                        break;

                    case false:
                        KCDFAlert.ShowAlert("Your Application could not submitted!" + isSubmitted);
                        Session.Remove("validOR");
                        break;
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                KCDFAlert.ShowAlert("Error Loading!");
            }
        }