示例#1
0
        public ActionResult Delete(string id)
        {
            INotifyTypeDao dao = _notifyTypeDao;

            dao.Delete(dao.Get(id));
            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }
 /// <summary>
 /// </summary>
 /// <param name="dao"></param>
 /// <exception cref="ArgumentNullException">dao is null.</exception>
 public void Save(INotifyTypeDao dao)
 {
     if (dao == null)
         throw new ArgumentNullException("dao");
     NotifyType type = Id != null ? dao.Get(Id) : new NotifyType();
     type.Name = Name;
     type.Remark = Remark;
     type.CommunicationType = CommunicationType;
     dao.SaveOrUpdate(type);
     dao.Flush();
 }
        /// <summary>
        /// </summary>
        /// <param name="dao"></param>
        /// <exception cref="ArgumentNullException">dao is null.</exception>
        public void Save(INotifyTypeDao dao)
        {
            if (dao == null)
            {
                throw new ArgumentNullException("dao");
            }
            NotifyType type = Id != null?dao.Get(Id) : new NotifyType();

            type.Name              = Name;
            type.Remark            = Remark;
            type.CommunicationType = CommunicationType;
            dao.SaveOrUpdate(type);
            dao.Flush();
        }
示例#4
0
        public ActionResult Edit(string id)
        {
            var result = new NotifyTypeModel(_notifyTypeDao.Get(id));

            return(View("Edit", result));
        }