using System;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Winson.EntityOP;
using Winson.Framework.Utility;
using System.Collections.Specialized;
using System.Collections;
using Winson.Framework.Controls;
using Winson.EntityOP.Entity;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            
            
            //byte[] b = Utility.ReadFile(@"d:\01.jpg");
            //Test test = new Test();
            //TestDS t = new TestDS();
            //NameValueCollection conditionValue = new NameValueCollection();
            //conditionValue["id"] = "100";
            //t = test.GetEntity(conditionValue);
            //Response.Write(t.Id.ToString());

            //string str = "1,2,3";
            //NameValueCollection conditionValue = new NameValueCollection();
            //conditionValue["name in"] = "wer,sdd";
            //IList TestList = test.GetList(conditionValue);
            //foreach (TestDS d in TestList)
            //{
            //    Response.Write(d.Id.ToString()+",");
            //}
            //Response.Write("<br>"+TestList.Count);

            //test.Entity.Age = 20;
            //test.Entity.Name = "Winson";
            //test.AppendEntity();
            //test.CreateEntity();
            //test.Entity.Datetime = System.DateTime.Now;
            //test.Entity.Context = "Test context";
            //test.Entity.Pic = b;
            //test.AppendEntity();
            //if (test.AddBatch())
            //    Response.Write("success");
            //else
            //    Response.Write("fail");


            //test.Entity.Id = 3;
            //test.Entity.Name = "王者见习";
            //if(test.Delete()>0)
            //    Response.Write("success");
            //else
            //    Response.Write("fail");



            //if (writeFile(b, @"d:\temp\30.jpg"))
            //{
            //    Response.Write("成功1");
            //}

            //else { Response.Write("失败1"); }

            //ModelCollection<TestDS> TestList = new ModelCollection<TestDS>();
            //TestDS t;
           
            //for (int n = 5; n < 100; n++)
            //{
            //    t = new TestDS();
            //    t.Id = n + 1;
            //    t.Age = 333;
            //    t.Context = "888";
            //    t.Datetime = DateTime.Now;
            //    if(t.Id==2)
            //        t.Isuse = false;
            //    //t.Name = "ksdf";
            //    //t.Pic = b;
            //    TestList.Add(t);
            //}

            //TestOP op = new TestOP();
            //DateTime startTime1 = DateTime.Now;
            //if (op.AddBatch(TestList))
            //    Response.Write("成功!!!!!!!!!!!!");
            //else
            //    Response.Write("失败!!!!!!!!!!");
            //DateTime endTime1 = DateTime.Now;
            //System.TimeSpan ts1 = endTime1 - startTime1;

            //Response.Write("<br><br>执行时间:" + ts1.Milliseconds + " 毫秒");

            //paramValue["id"] = "6";
            //t.Age = 50;
            //if (op.Update(t, paramValue) > 0)
            //    Response.Write("ok");
            //else
            //    Response.Write("no");

            //paramValue["id"] = "6";
            //if (op.Delete(paramValue) > 0)
            //    Response.Write("ok");
            //else
            //    Response.Write("no");


            //t = op.GetModel(paramValue);
            //byte[] bytes = t.Pic;
            //Response.Write(t.Name);

            //if (Utility.writeFile(b, @"d:\temp\31.png"))
            //{
            //    Response.Write("成功2");
            //}

            //else { Response.Write("失败2"); }


        }

    }

   


}
