コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: nehnre/luxman
 protected void Page_Load(object sender, EventArgs e)
 {
     BrandIdea po = new BrandIdea();
     po.biType = "type";
     po.biContent = "content";
     BrandIdeaDAO dao = new BrandIdeaDAO();
     dao.insert(po);
 }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: nehnre/luxman
        protected void Page_Load(object sender, EventArgs e)
        {
            BrandIdea po = new BrandIdea();

            po.biType    = "type";
            po.biContent = "content";
            BrandIdeaDAO dao = new BrandIdeaDAO();

            dao.insert(po);
        }
コード例 #3
0
ファイル: BrandIdeaDAO.cs プロジェクト: nehnre/luxman
        public int insert(BrandIdea po)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("insert into BrandIdea values(newid(), ");
            sql.Append(String.Format("{0},", DbAccess.parse(po.biType)));
            sql.Append(String.Format("{0},", DbAccess.parse(po.biContent)));
            sql.Append("getdate(), getdate())");

            return DbAccess.executeUpdate(sql.ToString());
        }
コード例 #4
0
        public int insert(BrandIdea po)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("insert into BrandIdea values(newid(), ");
            sql.Append(String.Format("{0},", DbAccess.parse(po.biType)));
            sql.Append(String.Format("{0},", DbAccess.parse(po.biContent)));
            sql.Append("getdate(), getdate())");

            return(DbAccess.executeUpdate(sql.ToString()));
        }
コード例 #5
0
ファイル: BrandIdeaDAO.cs プロジェクト: nehnre/luxman
        public int update(BrandIdea po)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("update BrandIdea set ");
            sql.Append(String.Format("bi_type={0},", DbAccess.parse(po.biType)));
            sql.Append(String.Format("bi_content={0},", DbAccess.parse(po.biContent)));
            sql.Append("bi_update_time=getdate()");
            sql.Append(String.Format(" where bi_id='{0}'", po.biId));

            return DbAccess.executeUpdate(sql.ToString());
        }
コード例 #6
0
        public int update(BrandIdea po)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("update BrandIdea set ");
            sql.Append(String.Format("bi_type={0},", DbAccess.parse(po.biType)));
            sql.Append(String.Format("bi_content={0},", DbAccess.parse(po.biContent)));
            sql.Append("bi_update_time=getdate()");
            sql.Append(String.Format(" where bi_id='{0}'", po.biId));

            return(DbAccess.executeUpdate(sql.ToString()));
        }
コード例 #7
0
ファイル: BrandIdea.ashx.cs プロジェクト: nehnre/luxman
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string method = context.Request.Params["method"];

            if ("list".Equals(method))
            {
                string       ajax = context.Request.Params["ajax"];
                BrandIdeaDAO dao  = new BrandIdeaDAO();
                BrandIdea    bi   = new BrandIdea();
                bi.biType = context.Request.Params["biType"];
                DataSet ds     = dao.select(bi);
                string  result = "";
                if (String.IsNullOrEmpty(ajax))
                {
                    result = "_list = " + JsonCommon.ds2json(ds);
                }
                else
                {
                    result = JsonCommon.ds2json(ds);
                }
                context.Response.Write(result);
            }
            else if ("detail".Equals(method))
            {
                BrandIdeaDAO dao = new BrandIdeaDAO();
                BrandIdea    bi  = new BrandIdea();
                bi.biId = context.Request.Params["biId"];
                DataSet ds   = dao.select(bi);
                string  json = JsonCommon.ds2json(ds);
                context.Response.Write(json);
            }
            else if ("save".Equals(method))
            {
                string       biContent = HttpUtility.UrlDecode((context.Request.Params["biContent"]).Replace("@", "%"));
                string       biType    = context.Request.Params["biType"];
                string       biId      = context.Request.Params["biId"];
                BrandIdeaDAO dao       = new BrandIdeaDAO();
                BrandIdea    bi        = new BrandIdea();
                bi.biId      = biId;
                bi.biContent = biContent;
                bi.biType    = biType;
                dao.update(bi);
            }
        }
コード例 #8
0
ファイル: BrandIdea.ashx.cs プロジェクト: nehnre/luxman
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     string method = context.Request.Params["method"];
     if ("list".Equals(method))
     {
         string ajax = context.Request.Params["ajax"];
         BrandIdeaDAO dao = new BrandIdeaDAO();
         BrandIdea bi = new BrandIdea();
         bi.biType = context.Request.Params["biType"];
         DataSet ds = dao.select(bi);
         string result = "";
         if (String.IsNullOrEmpty(ajax))
         {
             result = "_list = " + JsonCommon.ds2json(ds);
         }
         else
         {
             result = JsonCommon.ds2json(ds);
         }
         context.Response.Write(result);
     }
     else if ("detail".Equals(method))
     {
         BrandIdeaDAO dao = new BrandIdeaDAO();
         BrandIdea bi = new BrandIdea();
         bi.biId = context.Request.Params["biId"];
         DataSet ds = dao.select(bi);
         string json = JsonCommon.ds2json(ds);
         context.Response.Write(json);
     }
     else if ("save".Equals(method))
     {
         string biContent = HttpUtility.UrlDecode((context.Request.Params["biContent"]).Replace("@", "%"));
         string biType = context.Request.Params["biType"];
         string biId = context.Request.Params["biId"];
         BrandIdeaDAO dao = new BrandIdeaDAO();
         BrandIdea bi = new BrandIdea();
         bi.biId = biId;
         bi.biContent = biContent;
         bi.biType = biType;
         dao.update(bi);
     }
 }
コード例 #9
0
ファイル: BrandIdeaDAO.cs プロジェクト: nehnre/luxman
        public DataSet select(BrandIdea po)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("select * from BrandIdea where 1=1");
            if (!String.IsNullOrEmpty(po.biType))
            {
                sql.Append(String.Format(" and bi_type={0}", DbAccess.parse(po.biType)));
            }

            if (!String.IsNullOrEmpty(po.biContent))
            {
                sql.Append(String.Format(" and bi_content={0}", DbAccess.parse(po.biContent)));
            }

            if (!String.IsNullOrEmpty(po.biId))
            {
                sql.Append(String.Format(" and bi_id='{0}'", po.biId));
            }

            sql.Append(" order by bi_update_time desc");

            return DbAccess.executeQuery(sql.ToString());
        }
コード例 #10
0
        public DataSet select(BrandIdea po)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from BrandIdea where 1=1");
            if (!String.IsNullOrEmpty(po.biType))
            {
                sql.Append(String.Format(" and bi_type={0}", DbAccess.parse(po.biType)));
            }

            if (!String.IsNullOrEmpty(po.biContent))
            {
                sql.Append(String.Format(" and bi_content={0}", DbAccess.parse(po.biContent)));
            }

            if (!String.IsNullOrEmpty(po.biId))
            {
                sql.Append(String.Format(" and bi_id='{0}'", po.biId));
            }

            sql.Append(" order by bi_update_time desc");

            return(DbAccess.executeQuery(sql.ToString()));
        }
コード例 #11
0
        public int delete(BrandIdea po)
        {
            string sql = String.Format("delete from BrandIdea where bi_id='{0}'", po.biId);

            return(DbAccess.executeUpdate(sql));
        }
コード例 #12
0
ファイル: BrandIdeaDAO.cs プロジェクト: nehnre/luxman
        public int delete(BrandIdea po)
        {
            string sql = String.Format("delete from BrandIdea where bi_id='{0}'", po.biId);

            return DbAccess.executeUpdate(sql);
        }