示例#1
0
        public ActionResult SubmitExpressInfo(ExpressModel model)
        {
            using (var dbcontext = new ExpressDBContext())
            {
                if (model.ExpressType == ExpressType.Receive)
                {
                    var express = new ExpressReceiveInfo();
                    express.ExpressNo   = model.ExpressNo;
                    express.MailType    = model.MailType;
                    express.Phone       = model.Phone;
                    express.ReceiveTime = DateTime.Now;
                    express.Status      = MailReceiveStatus.WaitForSign;
                    express.Name        = model.Name;
                    dbcontext.ExpressReceiveInfos.Add(express);
                }
                else
                {
                    var express = new ExpressSendInfo();
                    express.ExpressNo   = model.ExpressNo;
                    express.MailType    = model.MailType;
                    express.Phone       = model.Phone;
                    express.ReceiveTime = DateTime.Now;
                    express.Status      = MailSendStatus.WaitSend;
                    express.Name        = model.Name;
                    dbcontext.ExpressSendInfos.Add(express);
                }

                dbcontext.SaveChanges();
            }

            return(Json(new
            {
                Success = true
            }, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult SignExpress(SignModel singer)
        {
            using (var dbcontext = new ExpressDBContext())
            {
                var needSignExpress = dbcontext.ExpressReceiveInfos.FirstOrDefault(s => s.Id == singer.Id);
                if (needSignExpress != null)
                {
                    needSignExpress.Signer   = singer.Name;
                    needSignExpress.Signtime = DateTime.Now;
                    needSignExpress.Status   = MailReceiveStatus.AlreadySign;
                    dbcontext.SaveChanges();
                }
            }

            return(Json(new
            {
                Success = true
            }, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        public ActionResult SendExpress(int id)
        {
            using (var dbcontext = new ExpressDBContext())
            {
                var needSignExpress = dbcontext.ExpressSendInfos.FirstOrDefault(s => s.Id == id);
                if (needSignExpress != null)
                {
                    needSignExpress.SendTime = DateTime.Now;
                    needSignExpress.Status   = MailSendStatus.AlreadySend;
                    dbcontext.SaveChanges();
                }
            }


            return(Json(new
            {
                Success = true
            }, JsonRequestBehavior.AllowGet));
        }