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); }
protected void btnModify_Click(object sender, EventArgs e) { IBizOffer bizoffer = AlbianServiceRouter.GetService <IBizofferOperation>().LoadBizOffer(txtId.Text); 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>().Modify(bizoffer)) { txtId.Text = bizoffer.Id; ClientScript.RegisterClientScriptBlock(this.GetType(), "Save", "<script language=\"javascript\" type=\"text/javascript\">alert(\"Modify Success!\");</script>"); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "Save", "<script language=\"javascript\" type=\"text/javascript\">alert(\"Modify Fail!\");</script>"); } }
protected void btnFind_Click(object sender, EventArgs e) { IBizOffer bizoffer = AlbianServiceRouter.GetService <IBizofferOperation>().FindBizOffer(txtId.Text); txtDesc.Text = bizoffer.Description; txtId.Text = bizoffer.Id; txtName.Text = bizoffer.Name; txtPrice.Text = bizoffer.Price.ToString(); txtSellerId.Text = bizoffer.SellerId; txtSellerName.Text = bizoffer.SellerName; }
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); }
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)); }