Beispiel #1
0
 public ActionResult DetailBPKB(DetailBPKBPOProcViewModel model)
 {
     try
     {
         ITransaksiPOProcService svc = new TransaksiPOProcService();
         var result = svc.UpdateBPKB(model);
         this.AddNotification("Your Data Has Been Successfully Updated. ", NotificationType.SUCCESS);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         general.AddLogError("POProcurement DetailBPKB", ex.Message, ex.StackTrace);
         return(View("~/Views/Transaksi/Procurement/Index.cshtml", model));
     }
 }
        public DetailBPKBPOProcViewModel UpdateBPKB(DetailBPKBPOProcViewModel model)
        {
            var dc = new eprocdbDataContext();

            var resultpo = (from custpo in dc.CUSTOMPOs where custpo.PONUMBER == model.PONumber select custpo).SingleOrDefault();

            resultpo.ACTUALRECEIVEDBPKBHOFROMBRANCH = model.ActualReceivedDateBPKBHOFromBranch;
            resultpo.MODIFIED_DATE           = DateTime.Now;
            resultpo.MODIFIED_BY             = System.Web.HttpContext.Current.Session["UserID"].ToString();
            resultpo.ACTUALDATEDELIVEREDUNIT = model.TanggalBSTB;
            var result = (from custbpkb in dc.CUSTOMBPKBs where custbpkb.PONUMBER == model.PONumber select custbpkb).SingleOrDefault();

            result.ACTUALRECEIVEDBPKBDIHO  = model.ActualReceivedDateBPKBdiHO;
            result.ACTUALRECEIVEDBPKBDICAB = model.ActualReceivedDateBPKBdiCabang;
            result.DETAILPROBLEM           = model.DetailProblem;
            result.REASONREVISEBPKB        = model.ReasonForReviseBPKB;
            result.TGLSERAHBPKB            = model.BPKBGRDate;

            result.ACTUALDELIVERYBPKBTOFINANCE  = model.ActualDeliveredDateBPKBToFinance;
            result.TGLBPKBDIKIRIMKEMBALI        = model.BPKBDateSentBack;
            result.ACTUALRECEIVEDBPKBHOBACK     = model.ActualReceivedBPKBHOBack;
            result.DATEDELIVERYTOBRANCHORVENDOR = model.DateDeliveryToBranchVendor;
            result.NOBPKB                    = model.BPKBNumber;
            result.NOFAKTUR                  = model.NoFakturKendaraan;
            result.NOSERTIFIKAT              = model.NoSertifikatNIK;
            result.NOFORMULIRA               = model.NoFormulirA;
            result.KETSURATUBAHBENTUK        = model.KeteranganSuratUbahBentuk;
            result.NOSURATUBAHBENTUK         = model.NoSuratUbahBentuk;
            result.TGLSURATUBAHBENTUK        = model.TanggalSuratUbahBentuk;
            result.KETERANGANSURATRUBAHWARNA = model.KeteranganSuratUbahWarna;
            result.NOSURATRUBAHWARNA         = model.NoSuratUbahWarna;
            result.TANGGALSURATRUBAHWARNA    = model.TanggalSuratUbahWarna;
            result.NOSERTIFIKATREGUJITIPE    = model.NoSertifikatRegistrasiUjiTipe;
            result.REMARKSDETAILPROBLEM      = model.RemarksDetailProblem;
            result.KETBPKB                   = model.RemarksBPKB;
            result.STATUSBPKB                = model.StatusBPKB;
            result.MODIFIED_DATE             = DateTime.Now;
            result.MODIFIED_BY               = System.Web.HttpContext.Current.Session["UserID"].ToString();

            dc.SubmitChanges();
            UpdateStatus(model.PONumber);
            UpdateInvoiceStatus(model.PONumber);
            return(model);
        }