예제 #1
0
        public ActionResult UpdateCatatan(string catatan, string bulanBonus,
                                          string tahunBonus, string noPekerja, string isTemp = "")
        {
            ManageMessageId outputMsg;

            try
            {
                int month = Convert.ToInt32(bulanBonus);
                int year  = Convert.ToInt32(tahunBonus);
                HR_BONUS_SAMBILAN_DETAIL.UpdateCatatan(month, year, noPekerja, catatan);
                outputMsg = ManageMessageId.Kemaskini;
            }
            catch
            {
                outputMsg = ManageMessageId.Error;
            }

            if (!string.IsNullOrEmpty(isTemp))
            {
                return(RedirectToAction("TambahBonus",
                                        new
                {
                    month = bulanBonus,
                    year = tahunBonus,
                    message = outputMsg,
                    isTemp = "yes"
                }));
            }
            else
            {
                return(RedirectToAction("BonusSambilanDetail", new { month = bulanBonus, year = tahunBonus, message = outputMsg }));
            }
        }
 public ActionResult TambahBonus(string bulanBekerja, string bulanDibayar,
                                 string tahunDibayar, string bulanBekerjaHingga, string Command)
 {
     if (Command == "Tambah")
     {
         //TODO add to HR_BONUS_SAMBILAN_DETAIL
         ManageMessageId outputMsg = ManageMessageId.Tambah;
         HR_BONUS_SAMBILAN_DETAIL.UpdateTambahBonus();
         return(RedirectToAction("UrusBonus", "PengurusanKakitanganSambilan",
                                 new { month = bulanDibayar, tahunbekerja = tahunDibayar, message = outputMsg }));
     }
     else if (Command == "Batal")
     {
         HR_BONUS_SAMBILAN_DETAIL.DeleteTambahBonus();
         return(RedirectToAction("TambahBonus",
                                 new { month = bulanDibayar, year = tahunDibayar }));
     }
     else //preview ("Pratonton")
     {
         List <BonusSambilanDetailModel> bonus = new List <BonusSambilanDetailModel>();
         ViewBag.MinBulan   = 0;
         ViewBag.MaxBulan   = 0;
         ViewBag.MaxTahun   = 0;
         ViewBag.BulanBonus = 0;
         try
         {
             int startMonth = Convert.ToInt32(bulanBekerja);
             int endMonth   = Convert.ToInt32(bulanBekerjaHingga);
             int month      = Convert.ToInt32(bulanDibayar);
             int year       = Convert.ToInt32(tahunDibayar);
             ViewBag.MinBulan   = startMonth;
             ViewBag.MaxBulan   = endMonth;
             ViewBag.BulanBonus = month;
             ViewBag.MaxTahun   = year;
             bonus = BonusSambilanDetailModel.GetDetailsFromTransaksi(startMonth, month, year, endMonth);
             if (bonus.Count() > 0)
             {
                 HR_BONUS_SAMBILAN_DETAIL.InsertTambahBonus(bonus); //add to database
             }
         }
         catch (Exception ex)
         {
             Console.Write(ex.ToString());
         }
         return(View(bonus));
     }
 }
예제 #3
0
        public ActionResult UpdateMuktamad(string bulanBonus, string tahunBonus, string noPekerja = null)
        {
            ManageMessageId outputMsg;

            try
            {
                int month = Convert.ToInt32(bulanBonus);
                int year  = Convert.ToInt32(tahunBonus);
                HR_BONUS_SAMBILAN_DETAIL.UpdateMuktamad(month, year, noPekerja);
                outputMsg = ManageMessageId.Muktamad;
            }
            catch
            {
                outputMsg = ManageMessageId.Error;
            }

            return(RedirectToAction("BonusSambilanDetail", new { month = bulanBonus, year = tahunBonus, message = outputMsg }));
        }
        public ActionResult TambahGandaan
            (string gandaan, string bulanBonus,
            string tahunBonus, string isTemp = "")
        {
            ManageMessageId outputMsg;

            try
            {
                int     month    = Convert.ToInt32(bulanBonus);
                int     year     = Convert.ToInt32(tahunBonus);
                decimal multiply = Convert.ToDecimal(gandaan);
                HR_BONUS_SAMBILAN_DETAIL.UpdateBonusDiterima(month, year, multiply);
                outputMsg = ManageMessageId.Kemaskini;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                outputMsg = ManageMessageId.Error;
            }

            if (!string.IsNullOrEmpty(isTemp))
            {
                return(RedirectToAction("TambahBonus",
                                        new
                {
                    month = bulanBonus,
                    year = tahunBonus,
                    message = outputMsg,
                    isTemp = "yes"
                }));
            }
            else
            {
                return(RedirectToAction("BonusSambilanDetail", new { month = bulanBonus, year = tahunBonus, message = outputMsg }));
            }
        }