Inheritance: System.Web.UI.Page
Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            notice notce = new notice();

            DataList1.DataSource = notce.SelectAllNotice();
            DataList1.DataBind();
        }
        public ActionResult DeleteConfirmed(int num)
        {
            notice notice = Db.notice.Find(num);

            Db.notice.Remove(notice);
            Db.SaveChanges();
            return(RedirectToAction("index"));
        }
 public ActionResult Edit(notice notice)
 {
     if (ModelState.IsValid)
     {
         Db.Entry(notice).State = EntityState.Modified;
         Db.SaveChanges();
         return(RedirectToAction("index"));
     }
     return(View(notice));
 }
        public ActionResult Delete(int num = 0)
        {
            notice notice = Db.notice.Find(num);

            if (notice == null)
            {
                return(HttpNotFound());
            }
            return(View(notice));
        }
 public ActionResult Create(notice notice)
 {
     if (ModelState.IsValid)
     {
         notice.CreationDate = DateTime.Now;
         Db.notice.Add(notice);
         Db.SaveChanges();
         return(RedirectToAction("index"));
     }
     return(View(notice));
 }
        public ActionResult NoticeDelete(int id)
        {
            notice NoteInfo = ne.notice.SingleOrDefault(a => a.id == id);

            ne.Set <notice>().Remove(NoteInfo);
            ne.SaveChanges();

            NoticeList       = ne.Set <notice>().ToList();
            ViewBag.NoteList = NoticeList;
            return(RedirectToAction("NoticeIndex"));
        }
        public ActionResult ChangeApproval(int num = 0)
        {
            string result = "";
            notice notice = Db.notice.Find(num);

            if (notice != null)
            {
                notice.IsApproval = notice.IsApproval == true ? false : true;
                result            = notice.IsApproval == true ? "Duyuru başarıyla onaylandı." : "Duyurunun onayı başarıyla kaldırıldı.";
                Db.SaveChanges();
            }
            return(Content("<script type=\"text/javascript\">SuccessInfo('" + result + "');</script>"));
        }
Beispiel #8
0
        public ActionResult AddNotice(notice re)
        {
            notice updatenotice          = null;
            HumanResourceContext context = new HumanResourceContext();

            if (re.ID == 0)
            {
                updatenotice = notrepo.Add(re);
            }
            else
            {
                updatenotice = notrepo.Update(re);
            }
            return(RedirectToAction("NoticeBoard", "HumanResource"));
        }
Beispiel #9
0
        public async Task <OperationResult <notice> > GetByIdAsync(int id)
        {
            notice notice = await noticeRepo.GetByIdAsync(id);

            if (notice != null)
            {
                return(new OperationResult <notice>()
                {
                    Success = true, Message = Messages.NOTICE_SUCCESS, Result = notice
                });
            }
            return(new OperationResult <notice>()
            {
                Success = false, Message = Messages.NOTICE_NOT_EXIST
            });
        }
 public ActionResult NoticeModify(notice EditNote)
 {
     if (!ModelState.IsValid)
     {
         return(Content("error"));
     }
     //publishInfo.EditTime = DateTime.Now;
     EditNote.edittime = DateTime.Now;
     UpdateModel <notice>(EditNote);
     ne.Entry(EditNote).State = EntityState.Modified;
     ne.SaveChanges();
     NoticeList       = ne.Set <notice>().ToList();
     ViewBag.NoteList = NoticeList;
     //return View("NoticeIndex");
     return(RedirectToAction("NoticeIndex"));
 }
 public ActionResult NewNotice(notice NewNote)
 {
     if (!ModelState.IsValid)
     {
         return(Content("error"));
     }
     NewNote.id       = Guid.NewGuid().ToInt32();
     NewNote.subtime  = DateTime.Now;
     NewNote.edittime = DateTime.Now;
     ne.notice.Add(NewNote);
     //ne.publishes.Add(NewNote);
     ne.SaveChanges();
     NoticeList       = ne.Set <notice>().ToList();
     ViewBag.NoteList = NoticeList;
     return(RedirectToAction("NoticeIndex"));
 }
Beispiel #12
0
        static void Main(string[] args)
        {
            Customer[] customerArr = new Customer[10];
            for (int i = 0; i < customerArr.Length; i++)
            {
                customerArr[i] = new Customer(i);
            }

            notice alramCust = null;

            alramCust += customerArr[1].sendCust;
            alramCust += customerArr[3].sendCust;
            alramCust += customerArr[5].sendCust;
            alramCust += customerArr[8].sendCust;

            alramCust("증권 찌라시");
        }
Beispiel #13
0
        /// <summary>
        /// 支付宝官网通知程序接口
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary <string, string> sPara = GetRequestPost();
            string jsonstr = "";
            int    pid     = 0;
            Dictionary <string, string> jsonlist = JMP.TOOL.UrlStr.GetRequestfrom(HttpContext.Current, "支付宝官网通知接口");

            if (jsonlist != null)
            {
                jsonstr = JMP.TOOL.JsonHelper.DictJsonstr(jsonlist);//把获取的参数转换成字符串
            }
            try
            {
                pid = !string.IsNullOrEmpty(Request.QueryString["pid"]) ? int.Parse(Request.QueryString["pid"].ToString()) : 0;
                Notify aliNotify    = new Notify(pid);
                bool   verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);
                if (verifyResult && pid > 0 && jsonlist["trade_status"] == "TRADE_SUCCESS")
                {
                    //买家付款时间
                    DateTime gmt_payment = DateTime.Parse(jsonlist["gmt_payment"]);
                    //订单金额(单位:元)
                    decimal             price       = jsonlist.ContainsKey("total_fee") ? decimal.Parse(jsonlist["total_fee"]) : decimal.Parse(jsonlist["total_amount"]);//支付金额(单位元)
                    string              buyer_email = jsonlist.ContainsKey("buyer_email") ? jsonlist["buyer_email"] : jsonlist["buyer_id"];
                    JMALI.notice.notice notic       = new notice();
                    string              message     = notic.PubNotice(jsonlist["out_trade_no"], price, gmt_payment, jsonlist["trade_no"], buyer_email, pid, "支付宝官网通知接口", jsonstr);
                    if (message == "ok")
                    {
                        Response.Write("success");
                    }
                    else
                    {
                        Response.Write("fail");
                    }
                }
                else
                {
                    Response.Write("fail");
                }
            }
            catch (Exception ex)
            {
                PayApiDetailErrorLogger.UpstreamNotifyErrorLog("获取到的参数:" + jsonstr + ",错误信息:" + ex, summary: "支付宝官网通知接口", channelId: pid);
                Response.Write("fail");
            }
        }
Beispiel #14
0
 public ActionResult fbgg(notice model)
 {
     if (model != null && model.content != null && model.content.Length > 0)
     {
         var user = (user)Session["user"];
         using (WeiQingEntities db = new WeiQingEntities())
         {
             var count = db.notice.Count();
             if (count == 0)
             {
                 model.addtime = DateTime.Now;
                 model.uid     = (int)user.id;
                 db.notice.Add(model);
                 return(Content(db.SaveChanges().ToString()));
             }
             else
             {
                 var notice = db.notice.OrderByDescending(x => x.addtime).FirstOrDefault();
                 if (notice != null && notice.id > 0)
                 {
                     notice.show    = model.show;
                     notice.content = model.content;
                     return(Content(db.SaveChanges().ToString()));
                 }
                 else
                 {
                     model.addtime = DateTime.Now;
                     model.uid     = (int)user.id;
                     db.notice.Add(model);
                     return(Content(db.SaveChanges().ToString()));
                 }
             }
         }
     }
     return(Content("参数错误"));
 }
Beispiel #15
0
        public void Send(HoptoadMessage message)
        {
            notice notice = new notice
            {
                version = "2.0",
                apikey = _apiKey,
                notifier = new notifier
               {
                   name = message.AppName,
                   version = message.AppVersion,
                   url = message.AppUrl
               },
                error = new error
                {
                    @class = message.ErrorClass,
                    message = message.ErrorMessage
                }
            };

            IList<backtraceLine> backtraceLines = new List<backtraceLine>();
            foreach (HoptoadBackTrack backTrack in message.BackTracks)
            {
                backtraceLines.Add(new backtraceLine()
                                       {
                                           file = backTrack.FileName,
                                           method = backTrack.MethodName,
                                           number = backTrack.LineNumber
                                       });
            }

            notice.error.backtrace = backtraceLines.ToArray();

            notice.serverenvironment = new serverEnvironment { environmentname = message.EnvironmentName };

            StringBuilder sb = new StringBuilder();

            using (StringWriter sw = new StringWriterWithEncoding(sb, Encoding.UTF8))
            {

                Console.WriteLine(sw.Encoding.EncodingName.ToString());

                XmlSerializer serializer = new XmlSerializer(typeof(notice));

                serializer.Serialize(sw, notice);
            }

            Console.WriteLine("This is the document: " + sb.ToString());

               //         HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://hoptoadapp.com/notifier_api/v2/notices");
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(_aggregatorUrl);
            request.Method = "POST";
            request.ContentType = "text/xml; encoding='utf-8'";
            byte[] encodedData = new UTF8Encoding().GetBytes(sb.ToString());

            request.ContentLength = encodedData.Length;

            using (Stream newStream = request.GetRequestStream())
            {
                newStream.Write(encodedData, 0, encodedData.Length);
            }

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new HoptoadException(response.StatusCode.ToString());
            }
        }
 public void add(notice entity)
 {
     ntc.Insert(entity.From, entity.Notice, entity.Date);
 }
        public ActionResult NoticeVisit(int id)
        {
            notice noteInfo = ne.Set <notice>().Where(u => u.id == id).FirstOrDefault();

            return(View(noteInfo));
        }