Exemple #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();
            IBizOffer bizoffer = AlbianObjectFactory.CreateInstance <BizOffer>();

            bizoffer.Id             = AlbianObjectFactory.CreateId("BOFF");
            bizoffer.CreateTime     = DateTime.Now;
            bizoffer.Creator        = txtSellerId.Text;
            bizoffer.Description    = txtDesc.Text;
            bizoffer.Discount       = null;
            bizoffer.IsDiscount     = null;
            bizoffer.LastModifier   = txtSellerId.Text;
            bizoffer.LastModifyTime = DateTime.Now;
            bizoffer.LastPrice      = decimal.Parse(txtPrice.Text);
            bizoffer.Name           = txtName.Text;
            bizoffer.Price          = decimal.Parse(txtPrice.Text);
            bizoffer.SellerId       = txtSellerId.Text;
            bizoffer.SellerName     = txtSellerName.Text;
            bizoffer.State          = BizofferState.Create;
            if (AlbianServiceRouter.GetService <IBizofferOperation>().Create(bizoffer))
            {
                txtId.Text = bizoffer.Id;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Save",
                                                       "<script language=\"javascript\" type=\"text/javascript\">alert(\"Create Success!\");</script>");
            }
            else
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Save",
                                                       "<script language=\"javascript\" type=\"text/javascript\">alert(\"Create Fail!\");</script>");
            }
            sw.Stop();
            Response.Write(sw.ElapsedMilliseconds);
        }
Exemple #2
0
        public bool Create(IUser user)
        {
            IUserDao dao = AlbianServiceRouter.ObjectGenerator <UserDao, IUserDao>();
            ILogInfo log = AlbianObjectFactory.CreateInstance <LogInfo>();

            log.Content    = string.Format("创建用户,用户id为:{0}", user.Id);
            log.CreateTime = DateTime.Now;
            log.Creator    = user.Id;
            log.Id         = AlbianObjectFactory.CreateId("Log");
            log.Style      = InfoStyle.Registr;
            IList <IAlbianObject> infos = new List <IAlbianObject> {
                user, log
            };

            return(dao.Create(infos));
        }
Exemple #3
0
        public virtual bool Modify(IBizOffer bizoffer)
        {
            ILogInfo log = AlbianObjectFactory.CreateInstance <LogInfo>();

            log.Content    = string.Format("修改发布单,发布单id为:{0}", bizoffer.Id);
            log.CreateTime = DateTime.Now;
            log.Creator    = bizoffer.Id;
            log.Id         = AlbianObjectFactory.CreateId("Log");
            log.Style      = InfoStyle.Publish;

            IList <IAlbianObject> list = new List <IAlbianObject> {
                bizoffer, log
            };
            IBizofferDao dao = AlbianServiceRouter.ObjectGenerator <BizofferDao, IBizofferDao>();

            return(dao.Modify(list));
        }
Exemple #4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            IUser user = AlbianObjectFactory.CreateInstance <User>();

            user.Id             = AlbianObjectFactory.CreateId("User");
            user.CreateTime     = DateTime.Now;
            user.Creator        = user.Id;
            user.LastModifier   = user.Id;
            user.LastMofidyTime = DateTime.Now;
            user.Mail           = txtMail.Text;
            user.Mobile         = txtMobile.Text;
            user.Nickname       = txtNickName.Text;
            user.Password       = txtPassword.Text;
            user.RegistrDate    = DateTime.Now;
            user.UserName       = txtUserName.Text;
            bool isSuccess = AlbianServiceRouter.GetService <IUserOperation>().Create(user);

            txtID.Text = user.Id;
        }
Exemple #5
0
        public bool Modify(string id, string nickName)
        {
            IUserDao dao  = AlbianServiceRouter.ObjectGenerator <UserDao, IUserDao>();
            IUser    user = dao.Load(id);

            user.Nickname       = nickName;
            user.LastMofidyTime = DateTime.Now;
            user.LastModifier   = id;

            ILogInfo log = AlbianObjectFactory.CreateInstance <LogInfo>();

            log.Content    = string.Format("修改用户,用户id为:{0}", user.Id);
            log.CreateTime = DateTime.Now;
            log.Creator    = user.Id;
            log.Id         = AlbianObjectFactory.CreateId("Log");
            log.Style      = InfoStyle.Modify;
            IList <IAlbianObject> infos = new List <IAlbianObject> {
                user, log
            };

            return(dao.Modify(infos));
        }