protected void btn_execute_Click(object sender, EventArgs e) { var btn = (Button)sender; var item = (RepeaterItem)btn.NamingContainer; var id = GetText(item, "hfSysId"); var eventtype = int.Parse(GetText(item, "hfEventType")); var factory = new BulkUpdateDetailsFactory(); var updateDetailsService = factory.CreateService(eventtype); Guid eventid = new Guid(); var updateSuccess = false; if (Guid.TryParse(id, out eventid)) { updateSuccess = updateDetailsService.UpdateProduct(eventid); } var msg = updateSuccess ? "已執行" : "執行失敗"; BindData(1, _pageSize); ScriptManager.RegisterStartupScript(Page, this.GetType(), "alertmsg", " alert('" + msg + "');", true); }
public BulkUpdateService() { _updateDetailsFactory = new BulkUpdateDetailsFactory(); }