Beispiel #1
0
        public async Task <ActionResult <ApplyForm> > PostApplyForm(ApplyForm applyForm)
        {
            _context.ApplyForms.Add(applyForm);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetApplyForm", new { id = applyForm.Id }, applyForm));
        }
Beispiel #2
0
        public async Task <IActionResult> PutApplyForm(int id, ApplyForm applyForm)
        {
            if (id != applyForm.Id)
            {
                return(BadRequest());
            }

            _context.Entry(applyForm).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ApplyFormExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        /// <summary>
        /// 命令执行
        /// </summary>
        /// <param name="context"></param>
        public override void Execute(DataContext context)
        {
            byte[] cmdData = context.CmdData;
            if (cmdData.Length == 0)
            {
                context.Flush(RespondCode.CmdDataLack);
                return;
            }

            ApplyForm form = cmdData.ProtoBufDeserialize <ApplyForm>();

            if (Compiled.Debug)
            {
                form.Debug("=== Extend.ApplySubmit 请求数据 ===");
            }

            UserCacheInfo userCache = UserBiz.ReadUserCacheInfo(context.UserId);
            ApplyInfo     applyInfo = new ApplyInfo
            {
                UserId     = context.UserId,
                SchoolId   = userCache.UserSite,
                UserName   = form.Name ?? string.Empty,
                Telphone   = form.Telphone ?? string.Empty,
                AreaCity   = null == form.City ? string.Empty : form.City.ToString(),
                CourseId   = form.CourseId,
                SourceAd   = form.SourceAd,
                Comment    = string.Empty,
                CreateDate = DateTime.Now
            };

            if (string.IsNullOrEmpty(applyInfo.UserName) || string.IsNullOrEmpty(applyInfo.Telphone) || string.IsNullOrEmpty(applyInfo.AreaCity))
            {
                context.Flush(RespondCode.DataInvalid);
                return;
            }

            ExtendBiz.SubmitApply(applyInfo);
            if (applyInfo.Id < 0)
            {
                context.Flush(RespondCode.ExecError);
                return;
            }

            StringSingle result = new StringSingle();

            if (applyInfo.Id > 0)
            {
                result.Data = "报名成功!请保持报名电话畅通,我们将在一个工作日内和您电话联系!";
            }
            else
            {
                result.Data = "您的报名信息已在处理中,请保持报名电话畅通,我们将在一个工作日内和您电话联系!";
            }

            context.Flush <StringSingle>(result);
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request["page"] != null)
     {
         page = Convert.ToInt32(Request["page"]);
     }
     if (Request["limit"] != null)
     {
         limit = Convert.ToInt32(Request["limit"]);
     }
     apply_page = ApplyForm.GetIng(limit, page);
     count      = ApplyForm.GetIngCount();
 }
 //public int condition = 0;// 0全部 1最近一个月
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request["page"] != null)
     {
         page = Convert.ToInt32(Request["page"]);
     }
     if (Request["limit"] != null)
     {
         limit = Convert.ToInt32(Request["limit"]);
     }
     //if (Request["condition"] != null)
     //{
     //    condition = Convert.ToInt32(Request["condition"]);
     //}
     apply_page = ApplyForm.GetEd(limit, page);
     count      = ApplyForm.GetEdCount();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            object username = Session["admin"];

            if (username == null)
            {
                Response.Redirect("index.aspx");
                return;
            }
            object page_num_ob = Request["page_num"];

            if (page_num_ob != null)
            {
                page_num = int.Parse(page_num_ob.ToString());
            }
            if (Request["status"] != null)
            {
                status = Convert.ToInt32(Request["status"]);
            }
            apply_page = ApplyForm.GetApplyInfoPage(10, page_num, status);
        }