public bool Product() /*Product * { //semantic rule related block using C# as host language * double v; * bool save_() {v= result;result=0; return true;} * bool mul_() {v*= result;result=0; return true;} * bool div_() {v/= result;result=0;return true;} * bool store_() {result= v;return true;} * } : * Value save_ * ('*' S Value mul_ * /'/' S Value div_)* store_ ;*/ { var _sem = new _Product(this); var result = And(() => Value() && _sem.save_() && OptRepeat(() => And(() => Char('*') && S() && Value() && _sem.mul_()) || And(() => Char('/') && S() && Value() && _sem.div_())) && _sem.store_()); return(result); }
public bool Product() /*Product * { //semantic rule related block using C# as host language (block can be implemented as nested struct) * internal _Product(calc0_direct parent){parent_=parent;} * calc0_direct parent_; * double v; * internal bool save_(){v= parent_.top.result;parent_.top.result=0; return true;} * internal bool mul_(){v*= parent_.top.result;parent_.top.result=0; return true;} * internal bool div_(){v/= parent_.top.result;parent_.top.result=0;return true;} * internal bool store_(){parent_.top.result= v;return true;} * } : * Value save_ * ('*' S Value mul_ * /'/' S Value div_)* store_ ;*/ { var _sem = new _Product(this); return(And(() => Value() && _sem.save_() && OptRepeat(() => And(() => Char('*') && S() && Value() && _sem.mul_()) || And(() => Char('/') && S() && Value() && _sem.div_())) && _sem.store_())); }
public _Product GetProductDetail(int id, long userID, Paging page) { _Product model = ModelConvertHelper <_Product> .ConverToModel(dal.GetModel(id)); if (model != null) { model.Comments = CommentBLL.Instance.GetCommentCallBack(id, CommentEnumType.Product.GetHashCode(), PriseEnumType.ProductComment.GetHashCode(), userID, page); return(model); } return(null); }
public Bee(Image image = null, string name = "NoName", _Product product = _Product.HoneyComb, _BeeType beeType = _BeeType.Meadow, string effects = "None", _Conditions conditions = new _Conditions(), _Gens gens = new _Gens()) { Name = name; Product = product; BeeType = beeType; Conditions = conditions; Gens = gens; Effects = effects; if (image == null) { this.image = Image.FromFile("../../Images/CommonBee.png"); } else { Image = image; } }
public ActionResult Detail(int id = 0) { if (id > 0) { Paging page = InitPage(); _Product model = ProductBLL.Instance.GetProductDetail(id, UserID, page); if (model == null) { return(RedirectToAction("Index", "Product")); } ViewBag.canSeeContact = UserInfo != null && (model.CreateUser == UserID.ToString() || FeeHRBLL.Instance.IsPayContact(UserID, id, 3)); return(View(model)); } else { return(RedirectToAction("Index")); } }
public bool Product() /*Product { //semantic rule related block using C# as host language (block can be implemented as nested struct) internal _Product(calc0_direct parent){parent_=parent;} calc0_direct parent_; double v; internal bool save_(){v= parent_.top.result;parent_.top.result=0; return true;} internal bool mul_(){v*= parent_.top.result;parent_.top.result=0; return true;} internal bool div_(){v/= parent_.top.result;parent_.top.result=0;return true;} internal bool store_(){parent_.top.result= v;return true;} } : Value save_ ('*' S Value mul_ /'/' S Value div_)* store_ ;*/ { var _sem= new _Product(this); return And(()=> Value() && _sem.save_() && OptRepeat(()=> And(()=> Char('*') && S() && Value() && _sem.mul_() ) || And(()=> Char('/') && S() && Value() && _sem.div_() ) ) && _sem.store_() ); }
/*Product { //semantic rule related block using C# as host language double v; bool save_() {v= result;result=0; return true;} bool mul_() {v*= result;result=0; return true;} bool div_() {v/= result;result=0;return true;} bool store_() {result= v;return true;} } : Value save_ ('*' S Value mul_ /'/' S Value div_)* store_ ;*/ public bool Product() { var _sem= new _Product(this); return And(()=> Value() && _sem.save_() && OptRepeat(()=> And(()=> Char('*') && S() && Value() && _sem.mul_() ) || And(()=> Char('/') && S() && Value() && _sem.div_() ) ) && _sem.store_() ); }
public bool Product() /*Product { //semantic rule related block using C# as host language double v; bool save_() {v= result;result=0; return true;} bool mul_() {v*= result;result=0; return true;} bool div_() {v/= result;result=0;return true;} bool store_() {result= v;return true;} } : Value save_ ('*' S Value mul_ /'/' S Value div_)* store_ ;*/ { var _sem= new _Product(this); return And(()=> Value() && _sem.save_() && OptRepeat(()=> And(()=> Char('*') && S() && Value() && _sem.mul_() ) || And(()=> Char('/') && S() && Value() && _sem.div_() ) ) && _sem.store_() ); }