Пример #1
0
        public void InsertConsumer()
        {
            IApplicationContext ctx = ContextRegistry.GetContext();

            IBLL.Owner.ConsumerIbo            ibo        = (IBLL.Owner.ConsumerIbo)ctx.GetObject("ConsumerBo");
            FactoryBo.Owner.ConsumerFactoryBo iboFactory = (FactoryBo.Owner.ConsumerFactoryBo)ctx.GetObject("ConsumerBoFactory");
            Entity.Owner.Consumer             consumer   = new Entity.Owner.Consumer();
            consumer.LevelId   = 1;
            consumer.CName     = "tianixao";
            consumer.CPassword = "******";
            consumer.CDate     = DateTime.Now.ToString();
            //ibo.InsertConsumer(consumer);
            iboFactory.GetConsumerBo().InsertConsumer(consumer);
        }
Пример #2
0
        private void login()
        {
            FactoryBo.Owner.ConsumerFactoryBo iboFactory =
                (FactoryBo.Owner.ConsumerFactoryBo)
                FactoryBo.Factory.Context.GetContextRegistry.GetContext()
                .GetObject("ConsumerBoFactory");
            Entity.Owner.Consumer consumer = new Entity.Owner.Consumer();
            consumer = iboFactory.ConsumerBo.GetConsumerIsExist(txtName.Text, txtPwd.Text);
            this.Session["Consumer"] = consumer;

            if (iboFactory.GetConsumerBo().ConsumerLogin(consumer))
            {
                Response.Redirect("index.html");
            }
            else
            {
                Page.RegisterStartupScript("scriptThree", "<script>alert('" + "登陆失败!" + "');</script>");
            }
        }
Пример #3
0
 private void login()
 {
     FactoryBo.Owner.ConsumerFactoryBo iboFactory =
         (FactoryBo.Owner.ConsumerFactoryBo)
         FactoryBo.Factory.Context.GetContextRegistry.GetContext()
         .GetObject("ConsumerBoFactory");
     Entity.Owner.Consumer consumer = new Entity.Owner.Consumer();
     consumer.LevelId         = 1;
     consumer.CName           = txtName.Text;
     consumer.CPassword       = txtPwd.Text;
     consumer.CDate           = DateTime.Now.ToString();
     this.Session["Consumer"] = consumer;
     if (iboFactory.GetConsumerBo().ConsumerLogin(consumer))
     {
         Response.Redirect("index.html");
     }
     else
     {
         Page.RegisterStartupScript("scriptThree", "<script>alert('" + "登陆失败!" + "');</script>");
     }
 }