예제 #1
0
        public static SalaryEmployeePayment GetSalaryEmployeePayment(Guid employeeId, string period, PajakTypeData.TaxType taxType)
        {
            APMDatabaseEntities databaseEntities = new APMDatabaseEntities();
            var res = from a in databaseEntities.SalaryEmployeePayments
                      where a.EmployeeId == employeeId && a.TaxType == (int)taxType && a.Period == period
                      select a;

            return(res.First());
        }
예제 #2
0
        public static C_Employee GetEmployee(string number)
        {
            APMDatabaseEntities databaseEntities = new APMDatabaseEntities();
            var res = from a in databaseEntities.C_Employee
                      where a.Number == number
                      select a;

            return(res.First());
        }
예제 #3
0
        public static List <SalaryEmployeePayment> GetListSalaryEmployeePayment(Guid employeeId, string year, PajakTypeData.TaxType taxType)
        {
            APMDatabaseEntities databaseEntities = new APMDatabaseEntities();
            var res = from a in databaseEntities.SalaryEmployeePayments
                      where a.EmployeeId == employeeId && a.TaxType == (int)taxType && a.Period.Substring(0, 4) == year
                      select a;
            List <SalaryEmployeePayment> list = res.ToList();

            return(list);
        }
예제 #4
0
        public static List <SalaryEmployeePayment> GetListPrevPeriodSalaryEmployeePayment(Guid employeeId, string year, string period, PajakTypeData.TaxType taxType)
        {
            APMDatabaseEntities databaseEntities = new APMDatabaseEntities();
            var res = from a in databaseEntities.SalaryEmployeePayments
                      where a.EmployeeId == employeeId && a.TaxType == (int)taxType && a.Period.Substring(0, 4) == year && a.Period.CompareTo(period) < 0
                      orderby a.LineNumber ascending
                      select a;
            List <SalaryEmployeePayment> list = res.ToList();

            List <SalaryEmployeePayment> list2 = new List <SalaryEmployeePayment>();
            int cari = 0;
            SalaryEmployeePayment s = list.LastOrDefault(x => x.EmployeeCondition == 3);

            cari  = list.LastIndexOf(s);
            list2 = list.GetRange(cari + 1, list.Count - cari - 1);
            return(list2);
        }