Ejemplo n.º 1
0
        public static long CreateIssue(Issue issue)
        {
            //Create a new issue
            long iid = 0;

            try {
                _Client = new IssueMgtServiceClient();
                iid     = _Client.CreateIssue(issue);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateIssue() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateIssue() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateIssue() communication error.", ce); }
            return(iid);
        }
Ejemplo n.º 2
0
    protected void OnButtonClick(object sender, EventArgs e)
    {
        //Event handler for command button clicked
        Button btn = (Button)sender;

        switch (btn.ID)
        {
        case "btnCancel":
            Response.Redirect("~/IssueMgt.aspx");
            break;

        case "btnOk":
            Issue     issue     = new Issue();
            CompanyDS companies = new IssueMgtServiceClient().GetCompanies();
            CompanyDS.CompanyTableRow[] rows = (CompanyDS.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_DISTRICTS: issue.DistrictNumber = (this.cboLocation.SelectedValue != "All" ? this.cboLocation.SelectedValue : ""); break;

            case SCOPE_REGIONS: issue.RegionNumber = (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.ContactID = Convert.ToInt32(this.cboContact.SelectedValue);
            issue.TypeID    = Convert.ToInt32(this.cboIssueType.SelectedValue);
            issue.Subject   = this.txtSubject.Text;
            //issue.OFD1FromDate = null;
            //issue.OFD1ToDate = null;
            //issue.PROID = null;
            IssueMgtServiceClient crgService = new IssueMgtServiceClient();
            long id = crgService.CreateIssue(issue);
            Response.Redirect("~/IssueMgt.aspx?issueID=" + id.ToString());
            break;
        }
    }
Ejemplo n.º 3
0
    protected void OnCommandClick(object sender, CommandEventArgs e)
    {
        //Event handler for command button clicked
        switch (e.CommandName)
        {
        case "Cancel":  Response.Redirect("~/Default.aspx"); break;

        case "OK":
            Issue     issue     = new Issue();
            CompanyDS companies = new IssueMgtServiceClient().GetCompanies();
            CompanyDS.CompanyTableRow[] rows = (CompanyDS.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_DISTRICTS: issue.DistrictNumber = (this.cboLocation.SelectedValue != "All" ? this.cboLocation.SelectedValue : ""); break;

            case SCOPE_REGIONS: issue.RegionNumber = (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.ContactID          = Convert.ToInt32(this.cboContact.SelectedValue);
            issue.TypeID             = Convert.ToInt32(this.cboIssueType.SelectedValue);
            issue.Subject            = this.txtSubject.Text;
            issue.OFD1FromDate       = issue.OFD1ToDate = DateTime.Today;
            issue.FirstActionUserID  = HttpContext.Current.User.Identity.Name;
            issue.CompanyIDSpecified = issue.StoreNumberSpecified = issue.ContactIDSpecified = issue.TypeIDSpecified = issue.OFD1FromDateSpecified = issue.OFD1ToDateSpecified = true;
            IssueMgtServiceClient crgService = new IssueMgtServiceClient();
            long id = crgService.CreateIssue(issue);
            Response.Redirect("~/Default.aspx?issueID=" + id.ToString());
            break;
        }
    }