public void saveAbsensi(string dataDetail)
		{
			int dataInput = 0;
			string[] RowData = dataDetail.Split('|');

			for (int i = 0; i < (RowData.Count() - 1); i++)
			{
				string[] value = RowData[i].Split(';');
				int year = int.Parse(value[0].ToString());
				int employeeId = int.Parse(value[1].ToString());
				int amount = int.Parse(value[2].ToString());

				db.sisaSaldoCutis.RemoveRange(db.sisaSaldoCutis.Where(x => x.year == year && x.employeeID == employeeId));
				sisaSaldoCuti abs = new sisaSaldoCuti();
				abs.year = year;
				abs.employeeID = employeeId;
				abs.amount = amount;
				db.sisaSaldoCutis.Add(abs);
				dataInput++;
			}

			if (dataInput > 0)
				db.SaveChanges();
		}
		private static void editSisaCuti(sisaSaldoCuti SisaCuti, int cutiYgdisetujui, string kategori)
		{
			if (kategori.Equals("tahunan"))
			{
				SisaCuti.countedApproved = SisaCuti.countedApproved + cutiYgdisetujui;
				SisaCuti.amount = SisaCuti.amount - cutiYgdisetujui;
			}
			else if (kategori.Equals("persalinan"))
			{
				SisaCuti.countedApproved2 = SisaCuti.countedApproved2 + cutiYgdisetujui;
				SisaCuti.amount2 = SisaCuti.amount2 - cutiYgdisetujui;
			}
			else if (kategori.Equals("kemalangan"))
			{
				SisaCuti.countedApproved3 = SisaCuti.countedApproved3 + cutiYgdisetujui;
				SisaCuti.amount3 = SisaCuti.amount3 - cutiYgdisetujui;
			}
			else if (kategori.Equals("lain-lain"))
			{
				SisaCuti.countedApproved4 = SisaCuti.countedApproved4 + cutiYgdisetujui;
				SisaCuti.amount4 = SisaCuti.amount4 - cutiYgdisetujui;
			}
			
		}
		public void loadAbsensi(int year)
		{
			var model = new sisaSaldoCuti();
			#region oldProcess
			//var empAbsensi = db.employees
			//                .Join(db.employeePositions
			//                        .Join(db.employeeResigns, c => c.employeeID, d => d.employeeID, (c, d) => new { c, d })
			//                            .Where(e => e.c.positionDate > e.d.resignDate)
			//                       , a => a.employeeID, b => b.c.employeeID, (a, b) => new { a, b })
			//                .Join(db.divisis, f => f.b.c.divisiID, g => g.deptID, (f, g) => new { f, g })
			//                .Join(db.levels, i => i.f.b.c.levelID, j => j.levelID, (i, j) => new {i,j})
			//                .Select(h => new { h.i.f.a.employeeID, h.i.f.a.employeeNIK, h.i.f.a.employeeName, deptName = h.i.g.divisiName, h.j.saldoCuti })
			//                .ToList();

			//for (int i = 0; i < empAbsensi.Count; i++)
			//{
			//    int amount = empAbsensi[i].saldoCuti;
			//    foreach (var att in db.sisaSaldoCutis.Where(x => x.year == year).ToList() as IEnumerable<Models.sisaSaldoCuti>)
			//    {
			//        if (att.employeeID == empAbsensi[i].employeeID)
			//        {
			//            amount = /*amount -*/ att.amount;
			//            break;
			//        }
			//    }

			//    var editor = new sisaSaldoCuti.saldoCutiDetail()
			//    {
			//        employeeID = empAbsensi[i].employeeID,
			//        employeeNIK = empAbsensi[i].employeeNIK,
			//        employeeName = empAbsensi[i].employeeName,
			//        deptName = empAbsensi[i].deptName,
			//        amount = amount
			//    };
			//    model.detailSaldoCuti.Add(editor);
			//}
			#endregion

			#region newProcess
			string sql = string.Empty;
			sql += "SELECT a.[employeeID],[employeeName],[employeeNIK],a.[deptName], ";
			sql += "ISNULL((select amount from [dbo].[SisaSaldoCutis] where employeeID = a.employeeID AND [year] = " + year + "), ";
			sql += "(SELECT saldoCuti from [dbo].[Levels] where levelID = a.levelID) ";
			sql += ") AS amount ";
			sql += "FROM [DB_AAJI].[dbo].[v_employee] a ";
			sql += "WHERE resignDate IS NULL ";
			DataTable dtEmployee = con.executeReader(sql);

			foreach (DataRow dr in dtEmployee.Rows)
			{
				var editor = new sisaSaldoCuti.saldoCutiDetail()
				{
					employeeID = int.Parse(dr["employeeID"].ToString()),
					employeeNIK = dr["employeeNIK"].ToString(),
					employeeName = dr["employeeName"].ToString(),
					deptName = dr["deptName"].ToString(),
					amount = int.Parse(dr["amount"].ToString())
				};
				model.detailSaldoCuti.Add(editor);
			}
			#endregion

			ViewBag.detailSaldoCuti = model.detailSaldoCuti.ToList();
		}