Esempio n. 1
0
        public IssueTypeDS GetIssueCategorys(string agentNumber)
        {
            //Get issue categories
            IssueMgtServiceClient client = null;
            IssueTypeDS           cats   = null;

            try {
                cats   = new IssueTypeDS();
                client = new IssueMgtServiceClient();
                IssueTypeDS _cats = client.GetIssueCategorys();
                if (agentNumber == null)
                {
                    cats.Merge(_cats);
                }
                else
                {
                    cats.Merge(_cats.IssueTypeTable.Select("Category='Agent/Local'"));
                }
                client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssueCategorys() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("GetIssueCategorys() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("GetIssueCategorys() communication error.", ce); }
            return(cats);
        }
Esempio n. 2
0
        public static DataSet GetIssues()
        {
            //Get issues
            IssueDS issues = new IssueDS();

            try {
                if (_IssueCache == null)
                {
                    _IssueCacheLastUpdate = DateTime.Today.AddDays(-IssueDaysBack);
                }
                DateTime fromDate = _IssueCacheLastUpdate;

                _Client = new IssueMgtServiceClient();
                DataSet ds = _Client.GetIssuesForDate(fromDate);
                _Client.Close();

                System.Diagnostics.Debug.WriteLine("PAYLOAD: fromDate=" + fromDate.ToString("MM/dd/yyyy HH:mm:ss") + "; bytes=" + ds.GetXml().Length);
                updateIssueCache(ds);
                if (_IssueCache != null)
                {
                    issues.Merge(_IssueCache);
                }
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssueCategorys() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetIssueCategorys() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetIssueCategorys() communication error.", ce); }
            return(issues);
        }
Esempio n. 3
0
 //Interface
 static CustomerProxy()
 {
     //
     _Client  = new IssueMgtServiceClient();
     _state   = true;
     _address = _Client.Endpoint.Address.Uri.AbsoluteUri;
 }
Esempio n. 4
0
        public IssueDS SearchIssues(string agentNumber, string searchText)
        {
            //Get issue search data
            IssueMgtServiceClient client = null;
            IssueDS issues = new IssueDS();

            try {
                if (searchText.Trim().Length > 0)
                {
                    client = new IssueMgtServiceClient();
                    if (agentNumber == null)
                    {
                        issues = client.SearchIssues(searchText);
                    }
                    else
                    {
                        issues = client.SearchIssuesForAgent(agentNumber, searchText);
                    }
                    client.Close();
                }
            }
            catch (FaultException fe) { throw new ApplicationException("SearchIssues() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("SearchIssues() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("SearchIssues() communication error.", ce); }
            return(issues);
        }
Esempio n. 5
0
        public AgentDS GetAgentsForClient(string clientNumber, string agentNumber)
        {
            //Get issue search data
            IssueMgtServiceClient client = null;
            AgentDS agents = null;

            try {
                agents = new AgentDS();
                client = new IssueMgtServiceClient();
                AgentDS _agents = client.GetAgentsForClient(clientNumber);
                if (agentNumber == null)
                {
                    agents.Merge(_agents);
                }
                else
                {
                    agents.Merge(_agents.AgentTable.Select("AgentNumber='" + agentNumber + "'"));
                }
                client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetAgentsForClient() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("GetAgentsForClient() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("GetAgentsForClient() communication error.", ce); }
            return(agents);
        }
Esempio n. 6
0
    protected void OnCompanyChanged(object sender, EventArgs e)
    {
        //Event handler for change in selected company
        //Validate
        if (this.cboCompany.SelectedItem == null)
        {
            return;
        }

        //Set applicable scopes for companies (i.e. client, pre-paid vendor)
        string    number    = this.cboCompany.SelectedValue;
        CompanyDS companies = new IssueMgtServiceClient().GetCompanies();

        CompanyDS.CompanyTableRow[] rows = (CompanyDS.CompanyTableRow[])companies.CompanyTable.Select("Number='" + number + "'");
        this.cboScope.Items.Clear();
        this.cboScope.Items.AddRange(new ListItem[] { new ListItem(SCOPE_AGENTS) });
        this.cboScope.SelectedValue = SCOPE_AGENTS;
        if (rows[0].CompanyType == "20")
        {
            //this.cboScope.Items.AddRange(new ListItem[] { new ListItem(SCOPE_DISTRICTS), new ListItem(SCOPE_REGIONS), new ListItem(SCOPE_STORES), new ListItem(SCOPE_SUBSTORES) });
            this.cboScope.Items.AddRange(new ListItem[] { new ListItem(SCOPE_STORES), new ListItem(SCOPE_SUBSTORES) });
            this.cboScope.SelectedValue = SCOPE_STORES;
        }

        //Update locations since company changed
        this.cboScope.Enabled = true;
        OnScopeChanged(null, EventArgs.Empty);
    }
Esempio n. 7
0
    private void showStoreDetail()
    {
        //
        this.txtStoreDetail.Text = "";
        if (this.cboCompany.SelectedValue.Length > 0 && this.txtStore.Text.Length > 0)
        {
            StoreDS   ds        = new StoreDS();
            CompanyDS companies = new IssueMgtServiceClient().GetCompanies();
            CompanyDS.CompanyTableRow[] rows = (CompanyDS.CompanyTableRow[])companies.CompanyTable.Select("Number='" + this.cboCompany.SelectedValue + "'");
            if (rows.Length > 0)
            {
                int companyID = rows[0].CompanyID;
                switch (this.cboScope.SelectedItem.ToString())
                {
                case SCOPE_STORES: ds.Merge(new IssueMgtServiceClient().GetStoreDetail(companyID, Convert.ToInt32(this.txtStore.Text))); break;

                case SCOPE_SUBSTORES: ds.Merge(new IssueMgtServiceClient().GetSubStoreDetail(companyID, this.txtStore.Text)); break;
                }
                if (ds.StoreTable.Rows.Count > 0)
                {
                    this.txtStoreDetail.Text = getStoreDetailString(ds);
                }
            }
        }
    }
Esempio n. 8
0
        public IssueDS GetIssues(string agentNumber)
        {
            //Get issue search data
            IssueMgtServiceClient client = null;
            IssueDS issues = null;

            try {
                client = new IssueMgtServiceClient();
                if (agentNumber == null)
                {
                    issues = client.GetIssues();
                }
                else
                {
                    issues = new IssueDS();
                    IssueDS _issues = client.GetIssues();
                    issues.Merge(_issues.IssueTable.Select("AgentNumber='" + agentNumber + "'"));
                    issues.Merge(_issues.IssueTable.Select("AgentNumber=''"));
                }
                client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssues() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("GetIssues() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("GetIssues() communication error.", ce); }
            return(issues);
        }
Esempio n. 9
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for page load event
        if (!Page.IsPostBack)
        {
            //Get query params
            long issueID = Convert.ToInt64(Request.QueryString["issueID"]);

            IssueMgtServiceClient client = new IssueMgtServiceClient();
            Issue issue = client.GetIssue(issueID);

            Response.Write("Issue Type:&nbsp;" + issue.Type + "<br />");
            Response.Write("Subject:&nbsp;" + issue.Subject + "<br />");
            Response.Write("Contact:&nbsp;" + issue.ContactName + "<br /><br />");
            Response.Write("Company:&nbsp;" + issue.CompanyName + "<br />");
            Response.Write("Store:&nbsp;" + issue.StoreNumber.ToString() + "<br />");
            Response.Write("Agent:&nbsp;" + issue.AgentNumber + "<br />");
            Response.Write("Zone:&nbsp;" + issue.Zone);

            CustomerProxy            cp      = new CustomerProxy();
            Argix.Customers.Action[] actions = cp.GetIssueActions(issueID);
            for (int i = 0; i < actions.Length; i++)
            {
                string cell = "<br /><br /><hr />";
                cell += actions[i].Created.ToString("g") + ", " + actions[i].UserID;
                cell += "<br />";
                cell += actions[i].TypeName;
                cell += "<br /><br />";
                cell += actions[i].Comment;
                Response.Write(cell);
            }
        }
    }
Esempio n. 10
0
    protected void OnIssueSelected(object sender, EventArgs e)
    {
        //Event handler for change in selected issue
        this.lblTitle.Text = "";
        if (this.grdIssues.SelectedRow != null)
        {
            //Unbold viewed issues/actions
            this.grdIssues.SelectedRow.Font.Bold = false;
            //int id = Convert.ToInt32(this.grdIssues.SelectedRow.Cells[1].Text);
            int      id  = Convert.ToInt32(this.grdIssues.SelectedDataKey[0]);
            DateTime dt1 = Convert.ToDateTime(this.grdIssues.SelectedRow.Cells[8].Text);
            if (this.mOldItems.ContainsKey(id))
            {
                this.mOldItems[id] = dt1;
            }
            else
            {
                this.mOldItems.Add(id, dt1);
            }

            Issue issue = new IssueMgtServiceClient().GetIssue(id);
            if (issue != null)
            {
                this.lblTitle.Text = issue.Type.Trim();
                if (issue.CompanyName.Trim() != "All")
                {
                    this.lblTitle.Text += ": " + issue.CompanyName.Trim();
                    if (issue.StoreNumber > 0)
                    {
                        this.lblTitle.Text += " #" + issue.StoreNumber.ToString();
                    }
                }
                else
                {
                    if (issue.AgentNumber.Trim() != "All")
                    {
                        this.lblTitle.Text += ": Agent#" + issue.AgentNumber.Trim();
                    }
                    else
                    {
                        this.lblTitle.Text += ": All Agents";
                    }
                }
                if (issue.Subject.Trim().Length > 0)
                {
                    this.lblTitle.Text += " - " + issue.Subject.Trim();
                }
            }
            this.lsvActions.SelectedIndex = 0;
            OnActionSelected(null, EventArgs.Empty);
        }
    }
Esempio n. 11
0
 public static byte[] GetAttachment(int id)
 {
     //Get an existing file attachment from database
     byte[] bytes = null;
     try {
         _Client = new IssueMgtServiceClient();
         bytes   = _Client.GetAttachment(id);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("GetAttachment() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetAttachment() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetAttachment() communication error.", ce); }
     return(bytes);
 }
Esempio n. 12
0
        public static int CreateContact(Contact contact)
        {
            int id = 0;

            try {
                _Client = new IssueMgtServiceClient();
                id      = _Client.CreateContact(contact);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateContact() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateContact() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateContact() communication error.", ce); }
            return(id);
        }
Esempio n. 13
0
        public static ContactDS GetContacts(int companyID, string regionNumber, string districtNumber, string agentNumber, string storeNumber)
        {
            ContactDS contacts = null;

            try {
                _Client  = new IssueMgtServiceClient();
                contacts = _Client.GetContactsForLocation(companyID, regionNumber, districtNumber, agentNumber, storeNumber);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetContacts() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetContacts() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetContacts() communication error.", ce); }
            return(contacts);
        }
Esempio n. 14
0
 public static Attachment[] GetAttachments(long issueID, long actionID)
 {
     //Get attachments for the specified action
     Attachment[] attachments = null;
     try {
         _Client     = new IssueMgtServiceClient();
         attachments = _Client.GetAttachments(issueID, actionID);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("GetAttachments() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetAttachments() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetAttachments() communication error.", ce); }
     return(attachments);
 }
Esempio n. 15
0
        public static bool UpdateContact(Contact contact)
        {
            bool res = false;

            try {
                _Client = new IssueMgtServiceClient();
                res     = _Client.UpdateContact(contact);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateContact() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateContact() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateContact() communication error.", ce); }
            return(res);
        }
Esempio n. 16
0
 public static Action[] GetActions(long issueID, long actionID)
 {
     //Get all actions chronologically prior to and including the specified action for the specified issue
     Action[] actions = null;
     try {
         _Client = new IssueMgtServiceClient();
         actions = _Client.GetActions(issueID, actionID);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("GetActions() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActions() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActions() communication error.", ce); }
     return(actions);
 }
Esempio n. 17
0
        public static CompanyDS GetCompanies(bool activeOnly)
        {
            //Companies
            CompanyDS companies = null;

            try {
                _Client   = new IssueMgtServiceClient();
                companies = _Client.GetActiveCompanies(activeOnly);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetCompanies() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCompanies() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCompanies() communication error.", ce); }
            return(companies);
        }
Esempio n. 18
0
        public static Issue GetIssue(long issueID)
        {
            //Get an existing issue
            Issue issue = null;

            try {
                _Client = new IssueMgtServiceClient();
                issue   = _Client.GetIssue(issueID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssue() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetIssue() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetIssue() communication error.", ce); }
            return(issue);
        }
Esempio n. 19
0
        public static bool CreateIssueAction(byte typeID, long issueID, string userID, string comment)
        {
            //Create a new action
            bool b = false;

            try {
                _Client = new IssueMgtServiceClient();
                b       = _Client.CreateIssueAction(typeID, issueID, userID, comment);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateIssueAction() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateIssueAction() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateIssueAction() communication error.", ce); }
            return(b);
        }
Esempio n. 20
0
        public static string GetActionType(int typeID)
        {
            //Get an action type  for the specified id
            string actionType = "";

            try {
                _Client    = new IssueMgtServiceClient();
                actionType = _Client.GetActionType(typeID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetActionType() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActionType() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActionType() communication error.", ce); }
            return(actionType);
        }
Esempio n. 21
0
        public static bool UpdateIssue(Issue issue)
        {
            //Update an existing issue
            bool b = false;

            try {
                _Client = new IssueMgtServiceClient();
                b       = _Client.UpdateIssue(issue);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateIssue() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateIssue() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateIssue() communication error.", ce); }
            return(b);
        }
Esempio n. 22
0
        public static IssueDS SearchIssuesAdvanced(object[] criteria)
        {
            //Get issue search data
            IssueDS search = new IssueDS();

            try {
                _Client = new IssueMgtServiceClient();
                search  = _Client.SearchIssuesAdvanced(criteria);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("SearchIssuesAdvanced() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("SearchIssuesAdvanced() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("SearchIssuesAdvanced() communication error.", ce); }
            return(search);
        }
Esempio n. 23
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);
        }
Esempio n. 24
0
        public static IssueTypeDS GetIssueCategorys()
        {
            //Issue type category
            IssueTypeDS categorys = new IssueTypeDS();

            try {
                _Client   = new IssueMgtServiceClient();
                categorys = _Client.GetIssueCategorys();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssueCategorys() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetIssueCategorys() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetIssueCategorys() communication error.", ce); }
            return(categorys);
        }
Esempio n. 25
0
        public static bool CreateIssueAttachment(string name, byte[] bytes, long actionID)
        {
            //Create a new issue
            bool saved = false;

            try {
                _Client = new IssueMgtServiceClient();
                saved   = _Client.CreateIssueAttachment(name, bytes, actionID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateIssueAttachment() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateIssueAttachment() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateIssueAttachment() communication error.", ce); }
            return(saved);
        }
Esempio n. 26
0
        public static IssueTypeDS GetIssueTypes(string issueCategory)
        {
            //Issue types- all or filtered by category
            IssueTypeDS issueTypes = null;

            try {
                _Client    = new IssueMgtServiceClient();
                issueTypes = _Client.GetIssueTypes(issueCategory);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssueTypes() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetIssueTypes() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetIssueTypes() communication error.", ce); }
            return(issueTypes);
        }
Esempio n. 27
0
        public static IssueDS IssueHistory(Issue issue)
        {
            //Get issue history data
            IssueDS history = new IssueDS();

            try {
                _Client = new IssueMgtServiceClient();
                history = new IssueDS(); //_Client.IssueHistory(issue);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("IssueHistory() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("IssueHistory() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("IssueHistory() communication error.", ce); }
            return(history);
        }
Esempio n. 28
0
        public static ActionTypeDS GetActionTypes(long issueID)
        {
            //Action types for an issue (state driven)
            ActionTypeDS actionTypes = null;

            try {
                _Client     = new IssueMgtServiceClient();
                actionTypes = _Client.GetIssueActionTypes(issueID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetActionTypes() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActionTypes() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActionTypes() communication error.", ce); }
            return(actionTypes);
        }
Esempio n. 29
0
        public static string GetCompany(int companyID)
        {
            //Get a company for the specified id
            string company = "";

            try {
                _Client = new IssueMgtServiceClient();
                company = _Client.GetCompany(companyID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetCompany() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCompany() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCompany() communication error.", ce); }
            return(company);
        }
Esempio n. 30
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new IssueMgtServiceClient();
                terminal = _Client.GetTerminalInfo();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminalInfo() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() communication error.", ce); }
            return(terminal);
        }