Ejemplo n.º 1
0
        public ActionResult WillowValleyDownload(WillowValleyModel mdlWillowValleyModel, string submit)
        {
            WillowValley objWillowValley = new WillowValley();

            mdlWillowValleyModel.StatementDate = objWillowValley.GetStatementDate();
            String folder = Server.MapPath(string.Format("~/WillowValley/{0}/", mdlWillowValleyModel.StatementDate));

            mdlWillowValleyModel.Active      = objWillowValley.CheckExistanceOfFolder(folder);
            mdlWillowValleyModel.IsEmailSent = objWillowValley.CheckExistance(mdlWillowValleyModel.StatementDate);
            if (submit == "Download")
            {
                return(GenarateZip(objWillowValley, folder, false));
            }
            else if (submit == "Process")
            {
                objWillowValley.ProcessFeed(mdlWillowValleyModel.StatementDate, folder);
                return(View("WillowValley", mdlWillowValleyModel));
            }
            else if (submit == "Send Email" && mdlWillowValleyModel.IsEmailSent == false)
            {
                bool isEmailSent = WillowValleySendEmail(objWillowValley, folder);
                if (isEmailSent)
                {
                    objWillowValley.UpdateXml(mdlWillowValleyModel.StatementDate);
                    mdlWillowValleyModel.IsEmailSent = true;
                }
                ViewBag.Message = isEmailSent ? DBQueries.msgEmailSuccess: DBQueries.msgEmailFailed;
                return(View("WillowValley", mdlWillowValleyModel));
            }
            else
            {
                return(View("WillowValley", mdlWillowValleyModel));
            }
        }
Ejemplo n.º 2
0
        public ActionResult WillowValley()
        {
            WillowValley      objWillowValley      = new WillowValley();
            WillowValleyModel mdlWillowValleyModel = new WillowValleyModel();

            mdlWillowValleyModel.StatementDate = objWillowValley.GetStatementDate();
            String folder = Server.MapPath(string.Format("~/WillowValley/{0}/", mdlWillowValleyModel.StatementDate));

            mdlWillowValleyModel.Active      = objWillowValley.CheckExistanceOfFolder(folder);
            mdlWillowValleyModel.IsEmailSent = objWillowValley.CheckExistance(mdlWillowValleyModel.StatementDate);
            return(View(mdlWillowValleyModel));
        }