Пример #1
0
        //Interface
        public dlgCompanyPaymentService(int entityID, bool parentIsActive, ref CompanyDS association)
        {
            //Constructor
            try {
                //Required designer support
                InitializeComponent();
                this.btnOk.Text     = CMD_OK;
                this.btnCancel.Text = CMD_CANCEL;

                //Set mediator service, data, and titlebar caption
                this.mEntityID       = entityID;
                this.mParentIsActive = parentIsActive;
                this.mAssociationDS  = association;
                if (this.mAssociationDS.CompanyPaymentServiceTable.Count > 0)
                {
                    this.mPaymentServiceID = this.mAssociationDS.CompanyPaymentServiceTable[0].PaymentServiceID;
                    this.Text = (this.mPaymentServiceID > 0) ? "Payment Service Asociation (" + this.mPaymentServiceID + ")" : "Payment Service Asociation (New)";
                }
                else
                {
                    this.Text = "Payment Service Association (Data Unavailable)";
                }
            }
            catch (Exception ex) { throw ex; }
        }
Пример #2
0
        public Employees GetEmployees(string idType)
        {
            //
            Employees employees = null;

            try {
                employees = new Employees();
                CompanyDS companyDS = new CompanyDS();
                DataSet   ds        = new DataSet();
                Database  db        = DatabaseFactory.CreateDatabase(idType);
                DbCommand cmd       = db.GetStoredProcCommand(USP_EMPLOYEEVIEW, new object[] {});
                db.LoadDataSet(cmd, ds, TBL_EMPLOYEEVIEW);
                if (ds != null)
                {
                    companyDS.Merge(ds, true, MissingSchemaAction.Ignore);
                    for (int i = 0; i < companyDS.EmployeeTable.Rows.Count; i++)
                    {
                        companyDS.EmployeeTable[i].HasPhoto     = (!companyDS.EmployeeTable[i].IsPhotoNull());
                        companyDS.EmployeeTable[i].HasSignature = (!companyDS.EmployeeTable[i].IsSignatureNull());
                        Employee employee = new Employee(companyDS.EmployeeTable[i]);
                        employees.Add(employee);
                    }
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading employees.", ex); }
            return(employees);
        }
Пример #3
0
        public string GetCompany(int companyID)
        {
            //Get a company for the specified id
            string company = "";

            try {
                CompanyDS companies         = GetCompanies();
                CompanyDS.CompanyTableRow c = (CompanyDS.CompanyTableRow)companies.CompanyTable.Select("CompanyID=" + companyID)[0];
                company = c.CompanyName;
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading contact.", ex); }
            return(company);
        }
Пример #4
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);
        }
Пример #5
0
        public CompanyDS GetCompanies(bool activeOnly)
        {
            //Get a list of active companies
            CompanyDS companies = new CompanyDS();
            string    filter    = activeOnly ? "IsActive = 1" : "";
            DataSet   ds        = fillDataset(USP_COMPANIES, TBL_COMPANIES, new object[] { });

            if (ds.Tables[TBL_COMPANIES].Rows.Count > 0)
            {
                CompanyDS _ds = new CompanyDS();
                _ds.CompanyTable.AddCompanyTableRow(0, "All", "000", "", 1);
                _ds.Merge(ds.Tables[TBL_COMPANIES].Select(filter, "CompanyName ASC"));
                companies.Merge(_ds);
            }
            return(companies);
        }