Beispiel #1
0
        public static void UpdateActionsetTab(SqlConnection connection, BizActionsetTab actionsetTab)
        {
            var sqlParamters = new[]
            {
                new SqlParameter("@id", actionsetTab.id),
                new SqlParameter("@action_bgimg", actionsetTab.action_bgimg ?? ""),
                new SqlParameter("@action_adproimg", actionsetTab.action_adproimg ?? ""),
                new SqlParameter("@action_explain", actionsetTab.action_explain ?? ""),
                new SqlParameter("@action_rule", actionsetTab.action_rule ?? ""),
                new SqlParameter("@action_label", actionsetTab.action_label ?? ""),
                new SqlParameter("@action_proname", actionsetTab.action_proname ?? ""),
                new SqlParameter("@action_proID", actionsetTab.action_proID ?? ""),
                new SqlParameter("@action_proimg", actionsetTab.action_proimg ?? ""),
                new SqlParameter("@action_needfriendcount", actionsetTab.action_needfriendcount),
                new SqlParameter("@action_totaljoinperson", actionsetTab.action_totaljoinperson),
                new SqlParameter("@action_totaldownprice", actionsetTab.action_totaldownprice),
                new SqlParameter("@action_endTime", actionsetTab.action_endTime),
                new SqlParameter("@action_dealmoney", actionsetTab.action_dealmoney),
                new SqlParameter("@action_static", actionsetTab.action_static),
                new SqlParameter("@action_updateTime", actionsetTab.action_updateTime),
                new SqlParameter("@action_introurl", actionsetTab.action_introurl ?? string.Empty),
                new SqlParameter("@action_endurl", actionsetTab.action_endurl ?? string.Empty)
            };

            SqlHelper.ExecuteNonQuery(connection, CommandType.Text,
                                      @"update Activity.dbo.actionsetTab set action_bgimg=@action_bgimg,action_adproimg=@action_adproimg,action_explain=@action_explain,action_rule=@action_rule
                    ,action_label=@action_label,action_proname=@action_proname,action_proID=@action_proID,action_proimg=@action_proimg,action_needfriendcount=@action_needfriendcount
,action_totaljoinperson=@action_totaljoinperson,action_totaldownprice=@action_totaldownprice,action_endTime=@action_endTime,action_dealmoney=@action_dealmoney,action_static=@action_static
,action_updateTime=@action_updateTime,action_introurl=@action_introurl,action_endurl=@action_endurl where id=@id"
                                      , sqlParamters);
        }
Beispiel #2
0
 public ActionResult AddActionsetTab(int?id)
 {
     if (id.HasValue && id.Value != 0)
     {
         ViewBag.Title = "修改模块";
         return(View(manager.GetActionsetTabByID(id.Value)));
     }
     else
     {
         ViewBag.Title = "新增模块";
         BizActionsetTab _Model = new BizActionsetTab()
         {
             id                     = 0,
             action_bgimg           = "",
             action_adproimg        = "",
             action_explain         = "",
             action_rule            = "",
             action_label           = "",
             action_proname         = "",
             action_proID           = "",
             action_proimg          = "",
             action_needfriendcount = 1,
             action_totaljoinperson = 1,
             action_totaldownprice  = 1,
             action_endTime         = DateTime.Now.AddDays(1),
             action_dealmoney       = 1,
             action_static          = false,
             action_introurl        = "",
             action_endurl          = ""
         };
         return(View(_Model));
     }
 }
Beispiel #3
0
        public static BizActionsetTab GetActionsetTabByID(SqlConnection connection, int id)
        {
            BizActionsetTab _ActionsetTab = null;
            var             parameters    = new[]
            {
                new SqlParameter("@id", id)
            };

            using (var _DR = SqlHelper.ExecuteReader(connection, CommandType.Text, @"SELECT TOP 1 
        id
      ,action_bgimg
      ,action_adproimg
      ,action_explain
      ,action_rule
      ,action_label
      ,action_proname
      ,action_proID
      ,action_proimg
      ,action_needfriendcount
      ,action_totaljoinperson
      ,action_totaldownprice
      ,action_endTime
      ,action_dealmoney
      ,action_static
      ,action_submitTime
      ,action_updateTime
      ,action_introurl
      ,action_endurl
FROM Activity.dbo.actionsetTab WHERE id=@id", parameters))
            {
                if (_DR.Read())
                {
                    _ActionsetTab                        = new BizActionsetTab();
                    _ActionsetTab.id                     = _DR.GetTuhuValue <long>(0);
                    _ActionsetTab.action_bgimg           = _DR.GetTuhuString(1);
                    _ActionsetTab.action_adproimg        = _DR.GetTuhuString(2);
                    _ActionsetTab.action_explain         = _DR.GetTuhuString(3);
                    _ActionsetTab.action_rule            = _DR.GetTuhuString(4);
                    _ActionsetTab.action_label           = _DR.GetTuhuString(5);
                    _ActionsetTab.action_proname         = _DR.GetTuhuString(6);
                    _ActionsetTab.action_proID           = _DR.GetTuhuString(7);
                    _ActionsetTab.action_proimg          = _DR.GetTuhuString(8);
                    _ActionsetTab.action_needfriendcount = _DR.GetTuhuValue <int>(9);
                    _ActionsetTab.action_totaljoinperson = _DR.GetTuhuValue <int>(10);
                    _ActionsetTab.action_totaldownprice  = _DR.GetTuhuValue <int>(11);
                    _ActionsetTab.action_endTime         = _DR.GetTuhuValue <DateTime>(12);
                    _ActionsetTab.action_dealmoney       = _DR.GetTuhuValue <decimal>(13);
                    _ActionsetTab.action_static          = _DR.GetTuhuValue <bool>(14);
                    _ActionsetTab.action_submitTime      = _DR.GetTuhuValue <DateTime>(15);
                    _ActionsetTab.action_updateTime      = _DR.GetTuhuValue <DateTime>(16);
                    _ActionsetTab.action_introurl        = _DR.GetTuhuString(17);
                    _ActionsetTab.action_endurl          = _DR.GetTuhuString(18);
                }
            }
            return(_ActionsetTab);
        }
Beispiel #4
0
        public ActionResult AddActionsetTab(BizActionsetTab actionsetTab)
        {
            string kstr      = "";
            bool   IsSuccess = true;

            if (string.IsNullOrEmpty(actionsetTab.action_proID))
            {
                kstr      = "所选产品不能为空";
                IsSuccess = false;
            }
            if (actionsetTab.action_dealmoney <= 0)
            {
                kstr      = "产品价格必须大于0";
                IsSuccess = false;
            }
            if (IsSuccess)
            {
                if (actionsetTab.id == 0)
                {
                    actionsetTab.action_submitTime = DateTime.Now;
                    actionsetTab.action_updateTime = DateTime.Now;
                    manager.AddActionsetTab(actionsetTab);
                }
                else
                {
                    actionsetTab.action_updateTime = DateTime.Now;
                    manager.UpdateActionsetTab(actionsetTab);
                }
                return(RedirectToAction("ActionsetTabs"));
            }
            else
            {
                string js = "<script>alert(\"" + kstr + "\");location='ActionsetTabs';</script>";
                return(Content(js));
            }
        }
Beispiel #5
0
        public static void AddActionsetTab(SqlConnection connection, BizActionsetTab actionsetTab)
        {
            var sqlParamters = new[]
            {
                new SqlParameter("@action_bgimg", actionsetTab.action_bgimg ?? ""),
                new SqlParameter("@action_adproimg", actionsetTab.action_adproimg ?? ""),
                new SqlParameter("@action_explain", actionsetTab.action_explain ?? ""),
                new SqlParameter("@action_rule", actionsetTab.action_rule ?? ""),
                new SqlParameter("@action_label", actionsetTab.action_label ?? ""),
                new SqlParameter("@action_proname", actionsetTab.action_proname ?? ""),
                new SqlParameter("@action_proID", actionsetTab.action_proID ?? ""),
                new SqlParameter("@action_proimg", actionsetTab.action_proimg ?? ""),
                new SqlParameter("@action_needfriendcount", actionsetTab.action_needfriendcount),
                new SqlParameter("@action_totaljoinperson", actionsetTab.action_totaljoinperson),
                new SqlParameter("@action_totaldownprice", actionsetTab.action_totaldownprice),
                new SqlParameter("@action_endTime", actionsetTab.action_endTime),
                new SqlParameter("@action_dealmoney", actionsetTab.action_dealmoney),
                new SqlParameter("@action_static", actionsetTab.action_static),
                new SqlParameter("@action_submitTime", actionsetTab.action_submitTime),
                new SqlParameter("@action_updateTime", actionsetTab.action_updateTime),
                new SqlParameter("@action_introurl", actionsetTab.action_introurl ?? string.Empty),
                new SqlParameter("@action_endurl", actionsetTab.action_endurl ?? string.Empty)
            };

            SqlHelper.ExecuteNonQuery(connection, CommandType.Text,
                                      @"insert into Activity.dbo.actionsetTab(action_bgimg
                      ,action_adproimg
                      ,action_explain
                      ,action_rule
                      ,action_label
                      ,action_proname
                      ,action_proID
                      ,action_proimg
                      ,action_needfriendcount
                      ,action_totaljoinperson
                      ,action_totaldownprice
                      ,action_endTime
                      ,action_dealmoney
                      ,action_static
                      ,action_submitTime
                      ,action_updateTime
                      ,action_introurl
                      ,action_endurl) 
                values (@action_bgimg
                      ,@action_adproimg
                      ,@action_explain
                      ,@action_rule
                      ,@action_label
                      ,@action_proname
                      ,@action_proID
                      ,@action_proimg
                      ,@action_needfriendcount
                      ,@action_totaljoinperson
                      ,@action_totaldownprice
                      ,@action_endTime
                      ,@action_dealmoney
                      ,@action_static
                      ,@action_submitTime
                      ,@action_updateTime
                      ,@action_introurl
                      ,@action_endurl)"
                                      , sqlParamters);
        }
Beispiel #6
0
 public void UpdateActionsetTab(BizActionsetTab actionsetTab)
 {
     handler.UpdateActionsetTab(actionsetTab);
 }
Beispiel #7
0
 public void AddActionsetTab(BizActionsetTab actionsetTab)
 {
     handler.AddActionsetTab(actionsetTab);
 }
Beispiel #8
0
        public void UpdateActionsetTab(BizActionsetTab actionsetTab)
        {
            Action <SqlConnection> action = (connection) => DalActionsetTab.UpdateActionsetTab(connection, actionsetTab);

            dbManager.Execute(action);
        }