예제 #1
0
        public async Task <ActionResult> SendEmail()
        {
            //var model = Request["model"]; // Errored
            HttpRequestBase request = HttpContext.Request;
            var             model   = request.Unvalidated.Form.Get("model");
            var             files   = Request.Files;
            var             dicimod = Newtonsoft.Json.JsonConvert.DeserializeObject <EmailModel>(model);

            byte[] data          = Convert.FromBase64String(Request["html"]);
            string decodedString = Encoding.UTF8.GetString(data);

            dicimod.emailBody = decodedString;
            List <HttpPostedFileBase> filee = new List <HttpPostedFileBase>();

            for (int i = 0; i < files.Count; i++)
            {
                filee.Add(Request.Files[i]);
            }

            ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin];
            string        UserId       = client.UserId;
            SendEmailRepo rep          = new SendEmailRepo();
            var           result       = await rep.SendEmail(filee, UserId, dicimod, client.Email, client.FirstName + " " + client.LastName);

            //var result = await rep.SendEmail(filee, UserId, dicimod, "*****@*****.**", client.FirstName + " " + client.LastName);
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public async Task <ActionResult> GetClaimList()
        {
            ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin];
            string        UserId       = client.UserId;
            SendEmailRepo rep          = new SendEmailRepo();
            var           data         = await rep.GetActivityClaims(UserId);

            //ClaimServices services = new ClaimServices();
            //var data = services.GetAllOpenClaims("", client.Teams);
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        public MagniPiEmailService()
        {
            //Logger.Debug("Inside MDMToolWorker Constructor");
            InitializeComponent();

            schedulertimer         = new Timer();
            schedulertimer.Enabled = true;

            int  ServiceTimerInMinutes     = Convert.ToInt32(ConfigurationManager.AppSettings["ServiceTimerInMinutes"]);
            long ServiceTimerInMiliSeconds = ServiceTimerInMinutes * 1000 * 60;

            schedulertimer.Interval = Convert.ToDouble(ServiceTimerInMiliSeconds);
            schedulertimer.Elapsed += this.Ready;

            _sendemailRepo = new SendEmailRepo();
        }
예제 #4
0
        public async Task <ActionResult> SendPaymentEmail()
        {
            HttpPostedFileBase file = null;
            var model   = Request["paymentModel"];
            var files   = Request.Files;
            var dicimod = Newtonsoft.Json.JsonConvert.DeserializeObject <PaymentEmailModel>(model);


            byte[] data          = Convert.FromBase64String(Request["html"]);
            string decodedString = Encoding.UTF8.GetString(data);

            dicimod.EmailBody = decodedString;

            ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin];
            string UserId = client.UserId;

            dicimod.BccEmail = client.Email;


            List <HttpPostedFileBase> filee = new List <HttpPostedFileBase>();

            for (int i = 0; i < files.Count; i++)
            {
                filee.Add(Request.Files[i]);
            }

            if (string.IsNullOrEmpty(dicimod.PaymentId) && Session[SessionHelper.PaymentAttachment] != null)
            {
                IEnumerable <HttpPostedFileBase> filesAttached = (IEnumerable <HttpPostedFileBase>)Session[SessionHelper.PaymentAttachment];
                if (filesAttached.Count() > 0)
                {
                    filee.Add(filesAttached.ToList()[0]);
                }
            }

            SendEmailRepo rep    = new SendEmailRepo();
            var           result = await rep.SendPaymentEmail(UserId, dicimod, filee, client.FirstName + " " + client.LastName);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public async Task <ActionResult> GetContactList(List <string> claimList)
        {
            try
            {
                List <string> returnlist = new List <string>();
                SendEmailRepo repo       = new SendEmailRepo();
                var           result     = await repo.GetContactList(claimList);

                foreach (var item in result)
                {
                    if (!string.IsNullOrEmpty(item.Code))
                    {
                        returnlist.Add(item.Code);
                    }
                }
                return(Json(returnlist, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
        public async Task <ActionResult> TeamDeleteClaimEmail(string emailId)
        {
            SendEmailRepo service = new SendEmailRepo();

            return(Json(await service.TeamDeleteClaimEmail(emailId), JsonRequestBehavior.AllowGet));
        }