private void LoadNewCouponEditor(CouponType newCouponType) { ViewState["NewCouponType"] = newCouponType.CouponTypeID; string editorControlPath = String.Format("~/Admin/CouponEditors/" + newCouponType.CouponClassType.FullName.Replace(".", "_") + ".ascx"); ICouponEditor editorControl = (ICouponEditor)Page.LoadControl(editorControlPath); editorControl.NewCoupon(newCouponType); editorControl.CouponSaved += new EventHandler <EventArgs>(editorControl_CouponSaved); editCouponPanel.Controls.Add((Control)editorControl); }
private void LoadCouponEditor(string couponCode) { Coupon cpn = Coupon.GetCoupon(couponCode); ViewState["NewCouponType"] = null; ViewState["CouponEditing"] = couponCode; string editorControlPath = String.Format("~/Admin/CouponEditors/" + cpn.CouponType.CouponClassType.FullName.Replace(".", "_") + ".ascx"); ICouponEditor editorControl = (ICouponEditor)Page.LoadControl(editorControlPath); editorControl.EditCoupon(cpn); editorControl.CouponSaved += new EventHandler <EventArgs>(editorControl_CouponSaved); editCouponPanel.Controls.Add((Control)editorControl); }