当前位置: 首页>>代码示例>>C#>>正文


C# Job.GetDesirableCriteria方法代码示例

本文整理汇总了C#中Job.GetDesirableCriteria方法的典型用法代码示例。如果您正苦于以下问题:C# Job.GetDesirableCriteria方法的具体用法?C# Job.GetDesirableCriteria怎么用?C# Job.GetDesirableCriteria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Job的用法示例。


在下文中一共展示了Job.GetDesirableCriteria方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyJob

        public ActionResult ApplyJob(JobApplyModel model, FormCollection col)
        {
            Job obj = new Job();
            string body = System.IO.File.ReadAllText(Server.MapPath("~/Template") + "/jobApplyEmail.html");

            DataTable dtConsultant = new DataTable();
            dtConsultant = obj.GetJobConsultant(model.JobId);
            string consultant = string.Empty;
            foreach (DataRow drConsultant in dtConsultant.Rows)
            {
                consultant = drConsultant["first"].ToString() + ",";
            }

            if (!string.IsNullOrEmpty(consultant))
                consultant = consultant.Remove(consultant.Length - 1, 1);

            DataTable dtEss = new DataTable();
            dtEss = obj.GetEssentialCriteria(model.JobId);
            string essentialCriteria = "<tr><td width='180' align='left' colspan='2'><b>Essential Criteria:</b></td><td align='left'></td></tr>";
            if (dtEss.Rows.Count > 0)
            {
                foreach (DataRow dr in dtEss.Rows)
                {
                    essentialCriteria = essentialCriteria + "<tr><td align='left' colspan='2'> &nbsp;&nbsp;&nbsp;<b>Q." + dr["description"].ToString() + "</b> </td></tr><tr><td align='left' colspan='2'> &nbsp;&nbsp;&nbsp;A." + col[dr["EssentialCriteriaId"].ToString()] + "</td></tr>";
                }
            }

            DataTable dtDesi = new DataTable();
            dtDesi = obj.GetDesirableCriteria(model.JobId);
            if (dtDesi.Rows.Count > 0)
            {
                string desirableCriteria = "<tr><td width='180' align='left' colspan='2'><b>Desirable Criteria:</b></td><td align='left'></td></tr>";
                foreach (DataRow dr in dtDesi.Rows)
                {
                    desirableCriteria = desirableCriteria + "<tr><td align='left' colspan='2'> &nbsp;&nbsp;&nbsp;<b>Q." + dr["description"].ToString() + "</b> </td></tr><tr><td align='left' colspan='2'> &nbsp;&nbsp;&nbsp;A." + col[dr["DesirableCriteriaId"].ToString()] + "</td></tr>";
                }

                essentialCriteria = essentialCriteria + desirableCriteria;
            }
            body = string.Format(body, model.JobTitle, model.ReferenceNo, consultant, model.FirstName, model.LastName, model.Email, model.ContactNumber, string.IsNullOrEmpty(col["retentionConsentChkBox"]) ? "NO" : "YES", essentialCriteria);

            MailMessage message = new MailMessage
            {
                From = new MailAddress(model.Email, model.FirstName + " " + model.LastName),
                Subject = "Job Application: " + model.JobTitle + " (" + model.FirstName + " " + model.LastName + "), Ref:" + model.ReferenceNo,
                Body = body,
                IsBodyHtml = true
            };
            message.To.Add(ConfigurationManager.AppSettings["jobEmail"].ToString());

            if (model.Attachment != null && model.Attachment.ContentLength > 0)
            {
                var attachment = new Attachment(model.Attachment.InputStream, model.Attachment.FileName);
                message.Attachments.Add(attachment);
            }

            if (model.CoverLetterOptional != null && model.CoverLetterOptional.ContentLength > 0)
            {
                var attachment = new Attachment(model.CoverLetterOptional.InputStream, model.CoverLetterOptional.FileName);
                message.Attachments.Add(attachment);
            }
            else if (!string.IsNullOrEmpty(model.CoverLetter))
            {
                //byte[] data = Encoding.ASCII.GetBytes(model.CoverLetter);
                //MemoryStream stm = new MemoryStream(data, 0, data.Length);
                //var attachment = new Attachment(stm, "coverLetter.doc");
                //message.Attachments.Add(attachment);
                string coverLetter = "<tr><td width='180' align='left' colspan='2'><b>Cover letter:</b></td></tr>";
                coverLetter += "<tr><td align='left' colspan='2'> " + model.CoverLetter + "</b> </td></tr>";
                body = body + coverLetter;
                message.Body = body;
            }

            string ackBody = System.IO.File.ReadAllText(Server.MapPath("~/Template") + "/jobAcknowledgement.html");
            ackBody = string.Format(ackBody, "<img src='" + ConfigurationManager.AppSettings["logoURL"].ToString() + "' />", model.FirstName, model.JobTitle, model.ReferenceNo);
            MailMessage ackMssage = new MailMessage
            {
                From = new MailAddress(ConfigurationManager.AppSettings["joEmailFrom"].ToString()),
                Subject = "Application Acknowledgement For : " + model.JobTitle,
                Body = ackBody,
                IsBodyHtml = true
            };
            ackMssage.To.Add(model.Email);

            SmtpClient sc = new SmtpClient();
            sc.Host = ConfigurationManager.AppSettings["smtpHost"].ToString();
            string smtpUser = ConfigurationManager.AppSettings["smtpUserName"].ToString();
            string smtpPwd = ConfigurationManager.AppSettings["smtpPassword"].ToString();
            sc.Credentials = new System.Net.NetworkCredential(smtpUser, smtpPwd);
            sc.Send(message);
            sc.Send(ackMssage);

            return base.View("JobApplyConfirm");
        }
开发者ID:santoshpisipati,项目名称:you-global,代码行数:94,代码来源:WorkController.cs

示例2: ApplyOnline

 //private readonly IJobPostingService _jobPostingService = ((IJobPostingService)HttpContext.Current.Application["JobPostingService"]);
 public ActionResult ApplyOnline(string reference)
 {
     JobApplyModel model = new JobApplyModel();
     Job obj = new Job();
     JobInfo info = obj.GetJobInfoByReferenceNo(reference);
     model.JobId = info.JobId;
     model.JobTitle = info.Title;
     model.ReferenceNo = reference;
     model.EssentialCriteriaList = obj.GetEssentialCriteria(info.JobId);
     model.DesirableCriteriaList = obj.GetDesirableCriteria(info.JobId);
     return base.View("JobApply", model);
 }
开发者ID:santoshpisipati,项目名称:you-global,代码行数:13,代码来源:WorkController.cs


注:本文中的Job.GetDesirableCriteria方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。