コード例 #1
0
 public void Setup()
 {
     manager   = new CategoryManager();
     category1 = new Category {
         name = "Apple US", image = "ca_appleus"
     };
     category2 = new Category {
         name = "Amazon", image = "ca_amazon"
     };
     manager.AddNew(category1);
     manager.AddNew(category2);
 }
コード例 #2
0
ファイル: add.aspx.cs プロジェクト: Minh740/diva123
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            CategoryManager CM       = new CategoryManager();
            CategoryTBx     category = new CategoryTBx();
            category.Name  = Request["name"];
            category.Order = Convert.ToInt32(Request["order"]);
            if (Convert.ToInt32(Request["parentID"]) != 0)
            {
                category.ParentID = Convert.ToInt32(Request["parentID"]);
            }
            category.Description = Request["description"];

            category.Status = 1;
            CM.AddNew(category);
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = 1
            }));
        }
        catch (Exception ex)
        {
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = -1,
                error   = ex
            }));
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CategoryTBx     category = new CategoryTBx();
        CategoryManager cm       = new CategoryManager();

        category.Name   = Request["cat"];
        category.Status = 1;
        cm.AddNew(category);
    }