コード例 #1
0
        protected void updatecate(object sender, EventArgs e)
        {
            string id = Request["id"];

            dc = new DTO_Categories();
            dc.Category_ID_   = txtcateid.Text;
            dc.Category_name_ = txtcatename.Text;
            dc.Description_   = txtdescription.Text;
            dc.Group_ID_      = txtgroupid.Text;
            bc.updateCategories(dc);
            Response.Redirect("Categories.aspx");
        }
コード例 #2
0
 protected void insertcate(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         dc = new DTO_Categories();
         dc.Category_ID_   = txtcateid.Text;
         dc.Category_name_ = txtcatename.Text;
         dc.Description_   = txtdescription.Text;
         dc.Group_ID_      = txtgroupid.Text;
         bc.insertCategories(dc);
         Response.Redirect("Categories.aspx");
     }
 }
コード例 #3
0
        public void insertCategories(DTO_Categories dc)
        {
            string sql = "insert into Categories values('" + dc.Category_ID_ + "',N'" + dc.Category_name_ + "',N'" + dc.Description_ + "',N'" + dc.Group_ID_ + "')";

            da.ExcuteNonQuery(sql);
        }
コード例 #4
0
        public void updateCategories(DTO_Categories dc)
        {
            string sql = "update Categories set category_name=N'" + dc.Category_name_ + "', description=N'" + dc.Description_ + "', group_ID=N'" + dc.Group_ID_ + "' where category_id='" + dc.Category_ID_ + "'";

            da.ExcuteNonQuery(sql);
        }