private void InitApplyPACSDB()
 {
     if (_applyPACSDB == null)
     {
         _applyPACSDB = new ApplyModel(_dbQuery);
     }
 }
示例#2
0
        public CustomJsonResult Apply(ApplyModel model)
        {
            CustomJsonResult result = new CustomJsonResult();

            result = BizFactory.ApplyPos.Apply(this.CurrentUserId, model.AgentId, model.SalesmanId, model.MerchantPosMachineIds);

            return(result);
        }
示例#3
0
        /// <summary>
        /// 切换学段获取教材
        /// </summary>
        /// <param name="subjectId"></param>
        /// <param name="stageId"></param>
        /// <returns></returns>
        public JsonResult GetBookListAndMovice(int subjectId, int stageId)
        {
            CookieHelper.SetCookie("StageID", stageId.ToString());
            ApplyModel   appModel = appbll.GetCourseAndMovice(subjectId.ToString(), stageId);
            KingResponse response = KingResponse.GetResponse(null, appModel);

            return(Json(response));
        }
示例#4
0
 public JsonResult Apply(ApplyModel apply)
 {
     if (ModelState.IsValid)
     {
         NewsletterManager.Apply(apply);
         return Json(new HttpStatusCodeResult(HttpStatusCode.OK), JsonRequestBehavior.AllowGet);
     }
     else
         throw new System.Exception(ModelState.GetErrorString());
 }
 public ActionResult DoApply(ApplyModel model)
 {
     if (model.Human && model.Alien)
     {
         ViewBag.Response = Globals.ErrorOnlyOneBoxCanBeSelected;
         ViewBag.Result   = false.ToString();
     }
     else if (model.Alien && !model.Human)
     {
         ViewBag.Response = Globals.ErrorNoAccountGranted;
         ViewBag.Result   = false.ToString();
     }
     else if (!model.Alien && model.Human)
     {
         if (model.Email != null && model.FullName != null && model.Username != null)
         {
             var emailAddress = model.Email.Trim().StripHtml();
             var fullName     = model.FullName.Trim().StripHtml();
             var userName     = model.Username.Trim().StripHtml();
             if (!Helper.ValidateEmail(emailAddress))
             {
                 ViewBag.Response = Globals.ErrorInvalidEmail;
                 ViewBag.Result   = false.ToString();
             }
             else
             {
                 var hashedPassword = HashUtility.HashPassword(model.Password);
                 var userCreated    = UserRepository.Create(userName, hashedPassword, fullName, emailAddress);
                 if (userCreated)
                 {
                     Helper.SendMail(emailAddress, fullName, userName, model.Password);
                     ViewBag.Response = Globals.InfoApplyApproved;
                     ViewBag.Result   = true.ToString();
                     LogHandler.Log(nameof(ApplyController), LogType.Info, string.Format("Account created \t email: {0} fullname: {1} username: {2}", emailAddress, fullName, userName));
                 }
                 else
                 {
                     ViewBag.Response = Globals.ErrorCreatingAccount;
                     ViewBag.Result   = false.ToString();
                 }
             }
         }
         else
         {
             ViewBag.Response = Globals.ErrorMustGiveInfo;
             ViewBag.Result   = false.ToString();
         }
     }
     else
     {
         ViewBag.Response = Globals.ErrorMustChooseBox;
         ViewBag.Result   = false.ToString();
     }
     return(View("Index"));
 }
示例#6
0
 /// <summary>
 /// 云课堂电影课
 /// </summary>
 /// <param name="subjectID"></param>
 /// <param name="stageID"></param>
 /// <returns></returns>
 public ApplyModel GetCourseAndMovice(string subjectID, int stageID)
 {
     using (var db = new ModMetaEntities())
     {
         using (var dbres = new MODResourceEntities())
         {
             ApplyModel appModel = new ApplyModel();
             appModel.CourseAllList = new CourseAllModel();
             // string[] grades = db.tb_Code_ListTable1_Relationship.Where(w => w.End_ID == stageID).Select(s => s.Start_ID.ToString()).ToArray();
             IQueryable <tb_Course> tempCourse = dbres.tb_Course.Where(w => w.Subject == subjectID && w.SchoolStage == stageID);
             int[] edi = tempCourse.Where(w => w.Coursetype != "movie").Select(s => s.EditionID).Distinct().ToArray();
             appModel.CourseAllList.EditionList = db.tb_Code_ListTable3.Where(w => edi.Contains(w.ID)).OrderBy(o => o.Seq).Select(s => new Edition
             {
                 EditionID   = s.ID,
                 EditionName = s.CodeName
             }).ToList();
             if (appModel.CourseAllList.EditionList != null && appModel.CourseAllList.EditionList.Count > 0)
             {
                 int ediID = appModel.CourseAllList.EditionList[0].EditionID;
                 appModel.CourseAllList.CourseList = tempCourse.Where(w => w.EditionID == ediID && w.Coursetype != "movie").OrderBy(o => o.CoursePath).Select(s => new CourseModel
                 {
                     CourseName = s.CourseName,
                     EditionID  = s.EditionID,
                     GradeID    = s.Grade,
                     ID         = s.ID,
                     ImageUrl   = AppSetting.ReslibUrl + "/DigitalClass/" + s.CoursePath + "/Course.gif",
                     IsOwnApply = ((s.Coursetype != "course") ?false:true)
                 }).ToList();
                 foreach (CourseModel course in appModel.CourseAllList.CourseList)
                 {
                     if (!course.IsOwnApply)
                     {
                         tb_Course       tempcourse = dbres.tb_Course.Find(course.ID);
                         int             grade      = int.Parse(tempcourse.Grade);
                         int             subject    = int.Parse(tempcourse.Subject);
                         tb_StandardBook book       = db.tb_StandardBook.Where(w => w.Edition == course.EditionID && w.Subject == subject && w.Grade == grade && w.Booklet == tempcourse.BookReel && w.Deleted == 0).FirstOrDefault();
                         course.ID = book.ID;
                     }
                 }
             }
             appModel.MoviceList = tempCourse.Where(w => w.Coursetype == "movie").OrderBy(o => o.Grade).Select(s => new MovieModel
             {
                 MoviceName = s.CourseName,
                 ID         = s.ID,
                 Url        = AppSetting.ReslibUrl + "/MovieListen/" + s.CoursePath + "/Start.htm",
                 ImageUrl   = AppSetting.ReslibUrl + "/MovieListen/" + s.CoursePath + "/Course.gif",
                 SubjectID  = s.Subject
             }).ToList();
             CacheHelper.Remove("CataIds");
             return(appModel);
         }
     }
 }
示例#7
0
        // GET: Apply
        public ActionResult Index(int subjectId = 3, int stageId = 2)
        {
            if (!string.IsNullOrEmpty(CookieHelper.GetCookieValue("StageID")))
            {
                stageId = int.Parse(CookieHelper.GetCookieValue("StageID"));
            }
            ApplyModel appModel = appbll.GetCourseAndMovice(subjectId.ToString(), stageId);

            ViewBag.StageID  = stageId;
            ViewBag.SubjetID = subjectId;
            return(View(appModel));
        }
示例#8
0
 public void Apply(ApplyModel model)
 {
     if (!Persistence.NewsletterRepository.AlreadySubscribed(model.Email))
     {
         Persistence.NewsletterRepository.Apply(model);
         Applyied?.Invoke(model.Email, EventArgs.Empty);
     }
     else
     {
         throw new Exception($"The e-mail {model.Email} is alread registred in our database!");
     }
 }
示例#9
0
        public async Task <IActionResult> Apply([FromBody] ApplyModel applyModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ApplicationView application = await applyModel.GetApplication(_dbContext, null);

            await _emailSender.SendApplicationConfirmAsync(application);

            return(Ok(application));
        }
示例#10
0
 public void Apply(ApplyModel model)
 {
     using (IDbConnection cn = new SQLiteConnection(_connectionString))
     {
         try
         {
             cn.Open();
             cn.Insert(model);
         }
         finally
         {
             cn.Close();
         }
     }
 }
示例#11
0
        public async Task <IActionResult> Apply([Bind("ApplyModel")] MapModel mapModel)
        {
            if (ModelState.IsValid)
            {
                ApplyModel applyModel = mapModel.ApplyModel;
                var        user       = await GetUser(applyModel.Email);

                ApplicationView application = await applyModel.GetApplication(_dbContext, user);

                await _emailSender.SendApplicationConfirmAsync(application);

                return(Ok());
            }

            return(Error());
        }
示例#12
0
        public JsonResult ApplyProbation(ApplyModel model)
        {
            JsonModel jm = new JsonModel();

            try
            {
                //如果表单验证成功
                if (ModelState.IsValid)
                {
                    //添加申请信息
                    IApplyInfoBLL applyInfoBll = BLLFactory <IApplyInfoBLL> .GetBLL("ApplyInfoBLL");

                    T_ApplyInfo info = new T_ApplyInfo()
                    {
                        CompanyName      = model.CompanyName,
                        Name             = model.Name,
                        Tel              = model.Tel,
                        OtherContactInfo = model.OtherContactInfo,
                        Memo             = model.Memo,
                        ApplyTime        = DateTime.Now
                    };
                    applyInfoBll.Save(info);

                    //发送邮件
                    string emailBody = GetMailBody(info);
                    if (!string.IsNullOrEmpty(emailBody))
                    {
                        string ApplyToName    = PropertyUtils.GetConfigParamValue("ApplyToName");
                        string ApplyToAddress = PropertyUtils.GetConfigParamValue("ApplyToAddress");
                        bool   flag           = PropertyUtils.SendEmail(ApplyToAddress, ApplyToName, "物业生活通-试用申请", emailBody);
                        if (!flag)
                        {
                            jm.Msg = "邮件发送失败";
                        }
                    }
                }
                else
                {
                    jm.Msg = "表单验证失败";
                }
            }
            catch
            {
                jm.Msg = "请求发生异常";
            }
            return(Json(jm, JsonRequestBehavior.AllowGet));
        }
示例#13
0
        public IActionResult GetModel()
        {
            ApplyModel applyModel = new ApplyModel()
            {
                OpportunityId = 1,
                OccurrenceIds = new List <int>()
                {
                    1, 2, 3, 4
                },
                Name        = "first last",
                Email       = "*****@*****.**",
                PhoneNumber = "7771119999",
                Message     = "application message"
            };

            return(Ok(applyModel));
        }
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var opportunity = await _context.Opportunities
                              .Include(o => o.Category)
                              .Include(o => o.Organization)
                              .Include(o => o.Community)
                              .Include(o => o.OpportunityImages)
                              .Include(o => o.Occurrences)
                              .ThenInclude(occ => occ.Applications)
                              .AsNoTracking()
                              .SingleOrDefaultAsync(m => m.Id == id);

            if (opportunity == null)
            {
                return(NotFound());
            }

            List <Occurrence> occurrences = opportunity.Occurrences
                                            .Where(o => o.ApplicationDeadline > DateTime.Now && o.Openings > o.Applications.Count)
                                            .Select(occ => OccurrenceTimeZoneConverter.ConvertFromUtc().Invoke(occ))
                                            .ToList();

            ApplyModel applyModel = new ApplyModel()
            {
                OpportunityId = opportunity.Id,
                Opportunity   = opportunity,
                Occurrences   = new SelectList(occurrences, "Id", "StartTime")
            };

            ViewData["Message"] = Message;
            return(View(applyModel));
        }