protected void OnCommandClick(object sender, CommandEventArgs e) { //Event handler for command button clicked try { switch (e.CommandName) { case "Cancel": Response.Redirect("~/Default.aspx"); break; case "OK": Issue issue = new Issue(); if (this.cboCompany.SelectedValue.Length > 0) { CompanyDataset companies = new CustomersGateway().GetCompanies(); CompanyDataset.CompanyTableRow[] rows = (CompanyDataset.CompanyTableRow[])companies.CompanyTable.Select("Number='" + this.cboCompany.SelectedValue + "'"); issue.CompanyID = rows[0].CompanyID; } switch (this.cboScope.SelectedValue) { case SCOPE_AGENTS: issue.AgentNumber = (this.cboLocation.SelectedValue != "All" ? this.cboLocation.SelectedValue : ""); break; case SCOPE_STORES: issue.StoreNumber = Convert.ToInt32(this.txtStore.Text); break; case SCOPE_SUBSTORES: issue.StoreNumber = Convert.ToInt32(this.txtStore.Text); break; } issue.Contact = this.txtContact.Text; issue.TypeID = Convert.ToInt32(this.cboIssueType.SelectedValue); issue.Subject = this.txtSubject.Text; issue.FirstActionUserID = HttpContext.Current.User.Identity.Name; Argix.Customers.Action action = new Argix.Customers.Action(); action.TypeID = Convert.ToByte(this.cboActionType.SelectedValue); action.IssueID = issue.ID; action.UserID = HttpContext.Current.User.Identity.Name; action.Comment = this.txtComments.Text; action.Created = DateTime.Now; issue.Actions = new Actions(); issue.Actions.Add(action); long id = new CustomersGateway().CreateIssue(issue); Response.Redirect("~/Default.aspx?issueID=" + id.ToString()); break; } } catch (Exception ex) { Master.ReportError(ex); } }
protected void OnOnCommand(object sender, CommandEventArgs e) { //Event handler for refresh button clicked switch (e.CommandName) { case "Back": Response.Redirect("ViewIssues.aspx?issueID=" + this.mIssueID.ToString()); break; case "New": Argix.Customers.Action action = new Argix.Customers.Action(); action.IssueID = this.mIssueID; action.TypeID = byte.Parse(this.cboActionType.SelectedValue); action.UserID = HttpContext.Current.User.Identity.Name; action.Created = DateTime.Now; action.Comment = this.txtComment.Text; bool added = new Argix.Customers.CustomersGateway().AddAction(action); this.lsvAction.DataBind(); break; } }
protected void OnCommandClick(object sender, CommandEventArgs e) { //Event handler for command button clicked try { switch (e.CommandName) { case "Cancel": Response.Redirect("~/Default.aspx?issueID=" + this.mIssueID.ToString()); break; case "OK": Argix.Customers.Action action = new Argix.Customers.Action(); action.TypeID = Convert.ToByte(this.cboActionType.SelectedValue); action.IssueID = this.mIssueID; action.UserID = HttpContext.Current.User.Identity.Name; action.Comment = this.txtComments.Text; bool ret = new CustomersGateway().AddAction(action); Response.Redirect("~/Default.aspx?issueID=" + this.mIssueID.ToString()); break; } } catch (Exception ex) { Master.ReportError(ex); } }