public StatementModelBuilder(DAL.Employer employer, bool current, int Yr, int period, int EmployeeId, string empNo, DAL.PayrollItem payrollitem, string Conn)
        {
            //initialize
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _current     = current;
            _EmployeeId  = EmployeeId;
            employee     = rep.GetEmployee(_EmployeeId);
            _employer    = employer;
            _ViewModel   = new StatementModel();
            _payrollitem = payrollitem;
            _year        = Yr;
            _period      = period;
            itemid       = payrollitem.Id;
            fileLogo     = _employer.Logo;
            slogan       = _employer.Slogan;

            var et = rep.GetEmployeeTxn(employee.EmpNo, _payrollitem.Id);

            if (et.Count() > 0)
            {
                emptxn = et.First();
            }
        }
Ejemplo n.º 2
0
        //used to make payslip for an employee
        public PayslipMaker(int Period, int Year, int EmployeeId, string EmpNo, string User, string Conn)
        {
            try
            {
                if (string.IsNullOrEmpty(Conn))
                {
                    throw new ArgumentNullException("connection");
                }
                connection = Conn;

                db  = new SBPayrollDBEntities(connection);
                rep = new Repository(connection);

                _PaymentPeriod = Period;
                _Year          = Year;
                _EmployeeId    = EmployeeId;
                _EmpNo         = EmpNo;
                _User          = User;
                anonymous      = false;

                //load settings
                if (!Load())
                {
                    _erorr  = true;
                    _errMsg = "Unable to load configs. please check the settings table";
                    Log.WriteToErrorLogFile(new Exception(_errMsg)); //log
                }
            }
            catch (Exception ex)
            {
                Log.WriteToErrorLogFile(ex);
            }
        }
Ejemplo n.º 3
0
        public NSSFReportBuilder(DAL.Employer employer, bool current, int period, int year, string Conn)
        {
            try
            {
                //initialization
                if (string.IsNullOrEmpty(Conn))
                {
                    throw new ArgumentNullException("connection");
                }
                connection = Conn;

                db  = new SBPayrollDBEntities(connection);
                rep = new Repository(connection);

                _year     = year;
                _period   = period;
                _current  = current;
                _employer = employer;

                fileLogo = _employer.Logo;
                slogan   = _employer.Slogan;
            }
            catch (Exception ex)
            {
                error = true;
                Utils.ShowError(ex);
            }
        }
        //constructor
        public ScheduleExcelBuilder(string Itemid, SheduleReportModel shedulemodel, string FileName, string Conn)
        {
            if (shedulemodel == null)
            {
                throw new ArgumentNullException("SheduleReportModel is null");
            }
            _ViewModel = shedulemodel;

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            if (Itemid == null)
            {
                throw new ArgumentNullException("Itemid is null");
            }
            _Itemid    = Itemid;
            sFileExcel = FileName;
        }
Ejemplo n.º 5
0
        public BankTransferMaker2(DAL.Employer _employer, bool current, int period, int year, string Conn)
        {
            try
            {
                if (string.IsNullOrEmpty(Conn))
                {
                    throw new ArgumentNullException("Conn");
                }
                connection = Conn;

                db  = new SBPayrollDBEntities(connection);
                rep = new Repository(connection);

                _year    = year;
                _current = current;
                _period  = period;
                employer = _employer;

                fileLogo = rep.SettingLookup("COMPANYLOGO");
                slogan   = rep.SettingLookup("COMPANYSLOGAN");
            }
            catch (Exception ex)
            {
                error = true;
                Utils.ShowError(ex);
            }
        }
Ejemplo n.º 6
0
        public EditBankBranch(BankBranch branch, Bank bank, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            if (bank == null)
            {
                throw new ArgumentNullException("Bank");
            }
            _bank = bank;

            if (branch == null)
            {
                throw new ArgumentNullException("BankBranch");
            }
            _BankBranch = branch;
        }
Ejemplo n.º 7
0
        public P10ReportMaker(DAL.Employer _employer, bool current, int Yr, string Conn)
        {
            try
            {
                //initialization
                if (string.IsNullOrEmpty(Conn))
                {
                    throw new ArgumentNullException("Conn");
                }
                connection = Conn;

                db  = new SBPayrollDBEntities(connection);
                rep = new Repository(connection);

                _year    = Yr;
                _current = current;

                employer = _employer;

                fileLogo = employer.Logo;
                slogan   = employer.Slogan;
            }
            catch (Exception ex)
            {
                error = true;
                Utils.ShowError(ex);
            }
        }
Ejemplo n.º 8
0
 public RolesListForm(string Conn)
 {
     InitializeComponent();
     if (string.IsNullOrEmpty(Conn))
     {
         throw new ArgumentNullException("connection");
     }
     connection = Conn;
     rep        = new Repository(connection);
     db         = new SBPayrollDBEntities(connection);
 }
Ejemplo n.º 9
0
        public PayrollMasterModel(string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);
        }
Ejemplo n.º 10
0
        public EditUser(DAL.spUser _user, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
                throw new ArgumentNullException("connection");
            connection = Conn;

            de = new DataEntry(connection);
            db = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);
            user = _user;
        }
Ejemplo n.º 11
0
        public PDFGen(string ResourcePath, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            rep = new Repository(connection);
            db  = new SBPayrollDBEntities(connection);

            resourcePath = ResourcePath;
        }
Ejemplo n.º 12
0
        public AddBenefit(string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);
        }
Ejemplo n.º 13
0
        public CPayroll(string user, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new BLL.DataEntry.DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _User = user;
        }
Ejemplo n.º 14
0
        public NonCashBenefits(DAL.Employee emp, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de       = new DataEntry(connection);
            db       = new SBPayrollDBEntities(connection);
            rep      = new Repository(connection);
            employee = emp;
        }
Ejemplo n.º 15
0
        public Settings(string sskey, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _SSKEY = sskey;
        }
        public NewNSSFComputationForm(string user, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _User = user;
        }
Ejemplo n.º 17
0
        public DepartmentsReportModelBuilder(DAL.Employer employer, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _employer = employer;

            fileLogo = _employer.Logo;
            slogan   = _employer.Slogan;
        }
Ejemplo n.º 18
0
        public EditDepartment(DAL.Department department, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _department = department;
        }
Ejemplo n.º 19
0
        public EditEmployer(DAL.Employer employer, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _employer = employer;
        }
Ejemplo n.º 20
0
        public EmployeesBankTransfersForm(int employerid, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _employerid = employerid;
        }
Ejemplo n.º 21
0
        public PayslipReader(int EmployeeId, string emp, int period, int year, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _EmployeeId    = EmployeeId;
            _EmpNo         = emp;
            _PaymentPeriod = period;
            _Year          = year;
        }
Ejemplo n.º 22
0
        public Payrolls(MainForm f, string Conn)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            MainForm = f;
            user     = f.LoggedInUser;
        }
Ejemplo n.º 23
0
        public EditRightForm(spAllowedRoleMenu right, string Conn)
        {
            InitializeComponent();
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            rep = new Repository(connection);
            db  = new SBPayrollDBEntities(connection);

            if (right == null)
            {
                throw new ArgumentNullException("right");
            }
            _right = right;
        }
Ejemplo n.º 24
0
        public EditPayrollItem(DAL.PayrollItem pitem, string Conn)
        {

            InitializeComponent();

            if (string.IsNullOrEmpty(Conn))
                throw new ArgumentNullException("connection");
            connection = Conn;

            de = new DataEntry(connection);
            db = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            if (pitem == null)
                throw new ArgumentNullException("PayrollItem");
            pi = pitem;

        }
Ejemplo n.º 25
0
        public NSSFPDFBuilder(NSSFReportModel nssfreportmodel, string FileName, string Conn)
        {
            if (nssfreportmodel == null)
            {
                throw new ArgumentNullException("NSSFReportModel is null");
            }
            _ViewModel = nssfreportmodel;

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            sFilePDF = FileName;
        }
        public BankBranchTransferModelBuilder1(DAL.Employer employer, bool current, int period, int year, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _year     = year;
            _current  = current;
            _period   = period;
            _employer = employer;

            fileLogo = _employer.Logo;
            slogan   = _employer.Slogan;
        }
Ejemplo n.º 27
0
        public P10AReportMaker(DAL.Employer employer, bool _current, int Yr, string Conn)
        {
            //initialization
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            current   = _current;
            _employer = employer;
            _year     = Yr;

            fileLogo = _employer.Logo;
            slogan   = _employer.Slogan;
        }
Ejemplo n.º 28
0
        public PayslipMakerAll2(List <Payslip> PayslipList, string FileName, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            if (PayslipList == null)
            {
                throw new ArgumentNullException("Payslip List is null");
            }
            payslipList = PayslipList;

            sFilePDF = FileName;
        }
Ejemplo n.º 29
0
        //constructor
        public PayrollMasterPDFBuilder(PayrollMasterModel payrollMasterModel, string FileName, string Conn)
        {
            if (payrollMasterModel == null)
            {
                throw new ArgumentNullException("PayrollMasterModel is null");
            }
            _ViewModel = payrollMasterModel;

            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            de  = new DataEntry(connection);
            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            sFilePDF = FileName;
        }
Ejemplo n.º 30
0
        //used to make anonymous payslip
        public PayslipMaker(decimal TaxablePay, string Conn)
        {
            if (string.IsNullOrEmpty(Conn))
            {
                throw new ArgumentNullException("connection");
            }
            connection = Conn;

            db  = new SBPayrollDBEntities(connection);
            rep = new Repository(connection);

            _Basic    = TaxablePay;
            anonymous = true;

            if (!Load())
            {
                _erorr = true;
                Log.WriteToErrorLogFile(new Exception("Unable to load configs. please check the settings table")); //log
            }
        }