Esempio n. 1
0
        public virtual void Execute()
        {
            //T_CMS_Master_ContractCollection
            try
            {
                REmployeeCollections objEmpMissingList = ReportManager.FiveDayReminder(new REmployeePara()
                {
                    EntityID = 10001, NumOfDay = 5, FromDate = SystemConfig.CurrentDate
                });
                if (objEmpMissingList.Count > 0)
                {
                    EmpReminderModel objReminder = new EmpReminderModel();
                    objReminder.EmployeeList = objEmpMissingList;
                    WorkflowMessageService.SendFiveDayReminderMessage("[email protected];[email protected];[email protected];", objReminder);
                }

                //get the probation List
                //QueuedEmailCollection objEmailList = T_CMS_Master_ContractManager.GetProbationContractList(1);

                //foreach (QueuedEmail queuedEmail in objEmailList)
                //{
                //    //Insert into QueEmail and the email will auto send by the system
                //    QueuedEmailManager.Add(queuedEmail);


                //}
                //QueuedEmailManager.Add(new QueuedEmail()
                //{
                //    CompanyID = 1,
                //    Id = 0,
                //    To = "*****@*****.**",
                //    CC= "*****@*****.**",
                //    From = "*****@*****.**",
                //    Subject="Reminder - Go to Binh Hung",
                //    Body="It is a day we spend together, please join Binh Hung Tour",
                // CreatedDate = DateTime.Now,
                // CreatedOnUtc = DateTime.UtcNow

                //});
            }
            catch (Exception exc)
            {
                // _logger.Error(string.Format("Error sending e-mail. {0}", exc.Message), exc);
            }
            finally
            {
                //queuedEmail.SentTries = queuedEmail.SentTries + 1;
                //    _queuedEmailService.UpdateQueuedEmail(queuedEmail);
            }
        }
Esempio n. 2
0
        public static REmployeeCollections FiveDayReminder(REmployeePara objPra)
        {
            REmployeeCollections items = new REmployeeCollections();

            using (var client = WebApiHelper.myclient(HouseEndpoint, SystemConst.APIJosonReturnValue))
            {
                HttpResponseMessage response = client.PostAsJsonAsync(string.Format("Report?Event=FiveD&Para="), objPra).GetAwaiter().GetResult();

                if (response.IsSuccessStatusCode)
                {
                    items = response.Content.ReadAsAsync <REmployeeCollections>().GetAwaiter().GetResult();
                }
            }

            return(items);
        }
Esempio n. 3
0
        public static REmployeeCollections GetReminderList(REmployeePara objPara)
        {
            REmployeeCollections collection = new REmployeeCollections();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "USP_TMS_NotCheckINOUT_Get", new SqlParameter[]
            {
                new SqlParameter("@EntityID", objPara.EntityID),
                new SqlParameter("@FromDate", objPara.FromDate),
                new SqlParameter("@NumOfDay", objPara.NumOfDay),
            }))
            {
                while (reader.Read())
                {
                    REmployee obj = new REmployee();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Esempio n. 4
0
        protected virtual string EmployeeListToHtmlTable(REmployeeCollections ObjEmpList)
        {
            string result;

            // var language = _languageService.GetLanguageById(languageId);

            var sb = new StringBuilder();

            sb.AppendLine("<table border=\"0\" style=\"width:100%;\">");

            //#region Products
            sb.AppendLine("<tr style=\"background-color:#1c84c6 !important;text-align:center;\">");
            sb.AppendLine(string.Format("<th>{0}</th>", L("S.No")));
            sb.AppendLine(string.Format("<th>{0}</th>", L("RMD.EmployeeNo")));
            sb.AppendLine(string.Format("<th>{0}</th>", L("RMD.AssociateName")));
            sb.AppendLine(string.Format("<th>{0}</th>", L("RMD.GroupName")));
            sb.AppendLine(string.Format("<th>{0}</th>", L("RMD.ReportDate")));
            sb.AppendLine(string.Format("<th>{0}</th>", L("RMD.DirectManagerName")));
            sb.AppendLine("</tr>");

            REmployee objEmp;

            for (int i = 0; i < ObjEmpList.Count; i++)
            {
                sb.AppendLine("<tr>");
                objEmp = ObjEmpList[i];
                sb.AppendLine(string.Format("<td>{0}</td>", i + 1));
                sb.AppendLine(string.Format("<td>{0}</td>", objEmp.EmployeeNo));
                sb.AppendLine(string.Format("<td>{0}</td>", objEmp.EmployeeName_EN));
                sb.AppendLine(string.Format("<td>{0}</td>", objEmp.GroupName));
                sb.AppendLine(string.Format("<td>{0}</td>", objEmp.RangeDate));
                sb.AppendLine(string.Format("<td>{0}</td>", objEmp.DirectManager));
                sb.AppendLine("</tr>");
            }

            sb.AppendLine("</table>");
            result = sb.ToString();
            return(result);
        }