Exemplo n.º 1
0
        //
        // GET: /SuperAdmin/MediumOperate/
        public ActionResult Index(int? id)
        {
            ViewBag.jsInit = Public.SuperAdminCommon.JSInit("MediumManage", "MediumOperate");
            var model = new Ba_Medium();
            if (id != null)
            {
                Medium dal = new Medium();
                model = dal.GetSinglemediumById((int)id);
            }
            if (model == null)
                model = new Ba_Medium();

            ViewBag.model = model;

            if (model.Ns_ID.Equals(0))
                ViewBag.Title = "新增媒體報道";
            else
                ViewBag.Title = "更新媒體報道";

            return View();
        }
Exemplo n.º 2
0
        public string Submit(MediumOperate_Form form)
        {
            string result = string.Empty;
            Medium dal = new Medium();
            var model = dal.GetSinglemediumById(form.medium_id);
            if (model == null)
                model = new Ba_Medium();
            model.Ns_Title = form.medium_title;
            model.Ns_SubTitle = form.medium_subtitle;
            model.Ns_Content = form.medium_description;
            model.Ns_BuildTime = DateTime.Now;
            model.Ns_State = true;
            try
            {
                dal.SaveOrUpdate(model);
                result = "1";
            }
            catch (System.Exception ex)
            {
                result = ex.ToString();
            }

            return result;
        }
Exemplo n.º 3
0
 public void SaveOrUpdate(Ba_Medium medium)
 {
     session.SaveOrUpdate(medium);
     session.Flush();
 }
Exemplo n.º 4
0
 public void Update(Ba_Medium medium)
 {
     session.Update(medium);
     session.Flush();
 }
Exemplo n.º 5
0
 public void Add(Ba_Medium medium)
 {
     session.Save(medium);
     session.Flush();
 }