Ejemplo n.º 1
0
        /// <summary>
        /// 添加月报
        /// </summary>
        /// <returns></returns>
        public ActionResult AddMonth(FormCollection form)
        {
            if (form.Count != 0)
            {
                Work_Note wn = new Work_Note();
                wn.WTitle = form["WTitle"];
                wn.WConetent = form["WConetent"];
                wn.WType = KSOAEnum.NoteType.M.ToString();
                Admin_KSCustomer aks = (Admin_KSCustomer)Session["member"];
                if (new Work_NoteLogic().AddWorkNote(wn, aks))
                {
                    ViewBag.msg = "添加成功";
                }
                else
                {
                    ViewBag.msg = "添加失败";
                }
            }

            return View();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 新增工作报告
        /// </summary>
        /// <returns></returns>
        public bool AddWorkNote(Work_Note wn, Admin_KSCustomer aks)
        {
            DataAccess.Work_Note wnote = new DataAccess.Work_Note();
            wnote.WTitle = wn.WTitle;
            wnote.WConetent = wn.WConetent;
            wnote.AddTime = DateTime.Now;
            wnote.WriterID = aks.ID;
            wnote.WriterName = aks.CusName;
            wnote.WType = wn.WType;
            wnote.WTaster = wn.WTaster;

            _db.Work_Note.AddObject(wnote);
            int result = _db.SaveChanges();
            if (result == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 编辑日报(根据ID读取对象)
 /// </summary>
 /// <returns></returns>
 public ActionResult EditDaily(int id)
 {
     Work_Note wn = new Work_NoteLogic().GetWork_NoteModel(id);
     if (wn == null)
     {
         wn = new Work_Note();
     }
     else
     {
         //标记为已阅
         new Work_NoteLogic().UpdateMark(id);
     }
     return View(wn);
 }