public IHttpActionResult DeleteManagementByRek(int IdData) { //UPDATE DI trxManagement trxManagement myData = _repository.Get(IdData); myData.IsActive = false; myData.Catatan = "DELETE BY REKANAN"; _repository.Put(IdData, myData); //INSERT DI trxManagement Blacklist trxManagementBlackListHistory ManagemenBLHist = new trxManagementBlackListHistory() { IdManagemen = myData.IdManagemen, Name = myData.Name, NomorKTP = myData.NomorKTP, NomorNPWP = myData.NomorNPWP, NomorProfesi = myData.NomorIAPI, ImageBaseName = myData.ImageBaseName, FileExtKTP = myData.FileExtKTP, FileExtNPWP = myData.FileExtNPWP, FileExtProfesi = myData.FileExtIAPI, TanggalMulaiBlackList = System.DateTime.Now, TanggalAkhirBlacklist = System.DateTime.Now, StatusBlackList = true, Catatan = "DELETE BY REKANAN", CreatedUser = "******", CreatedDate = System.DateTime.Now }; _repManagementBLHist.Post(ManagemenBLHist); return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult> Delete(int id, trxManagement Emp) { HttpResponseMessage responseMessage = await client.DeleteAsync(url + "/" + id); if (responseMessage.IsSuccessStatusCode) { return(RedirectToAction("Index")); } return(RedirectToAction("Error")); }
public async Task <ActionResult> AddUpdateManagemenBL(trxManagement myData) { bool bolSaveOK = false; if (myData.IdManagemen > 0) { HttpResponseMessage responseMessage = await client.PutAsJsonAsync(url + "/AddUpdateManagemenBL", myData); if (responseMessage.IsSuccessStatusCode) { bolSaveOK = true; } else { return(RedirectToAction("Error")); } } else { myData.CreatedDate = DateTime.Today; myData.CreatedUser = tokenContainer.UserId.ToString(); HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url + "/AddUpdateManagemenBL", myData); if (responseMessage.IsSuccessStatusCode) { bolSaveOK = true; } else { return(RedirectToAction("Error")); } } if (bolSaveOK) { HttpResponseMessage responseMessage1 = await client.GetAsync(url + "/GetManagemenBL"); if (responseMessage1.IsSuccessStatusCode) { var responseData1 = responseMessage1.Content.ReadAsStringAsync().Result; var myData1 = JsonConvert.DeserializeObject <List <trxManagement> >(responseData1); ViewBag.SimpanVisi = "visible"; ViewBag.EditVisi = "hidden"; ViewBag.IsReadOnly = false; return(PartialView("BLByPartner", myData1)); } } else { return(RedirectToAction("Error")); } return(RedirectToAction("Error")); }
public async Task <ActionResult> Create(trxManagement Emp) { Emp.CreatedDate = DateTime.Today; Emp.CreatedUser = tokenContainer.UserId.ToString(); Emp.IdRekanan = (System.Guid)tokenContainer.IdRekananContact; HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, Emp); if (responseMessage.IsSuccessStatusCode) { return(RedirectToAction("Index")); } return(RedirectToAction("Error")); }
public IHttpActionResult AddUpdateManagemenBL(trxManagement myData) { trxManagement notTemp = new trxManagement(); notTemp.InjectFrom(myData); if (myData.IdManagemen > 0) { _repManagement.PutPartner(notTemp.IdManagemen, notTemp); } else { _repManagement.PostPartner(notTemp); } return(Ok(notTemp)); }
public IHttpActionResult DoBlacklistById(int IdManagemen, int StatusBlacklist, string myCatatan, DateTime AkhirBlacklist) { //update TrxManagement myCatatan = Decode(myCatatan); trxManagement ManagementUPD = _repository.Get(IdManagemen); //ManagementUPD.IsActive = (StatusBlacklist == 1)? false: true; ManagementUPD.StatusBlackList = Convert.ToBoolean(StatusBlacklist); ManagementUPD.Catatan = myCatatan; ManagementUPD.TanggalAkhirBlacklist = AkhirBlacklist; _repository.Put(IdManagemen, ManagementUPD); //INSERT HISTORY trxManagementBlackListHistory ManagemenBLHist = new trxManagementBlackListHistory() { IdManagemen = ManagementUPD.IdManagemen, Name = ManagementUPD.Name, NomorKTP = ManagementUPD.NomorKTP, NomorNPWP = ManagementUPD.NomorNPWP, NomorProfesi = ManagementUPD.NomorIAPI, ImageBaseName = ManagementUPD.ImageBaseName, FileExtKTP = ManagementUPD.FileExtKTP, FileExtNPWP = ManagementUPD.FileExtNPWP, FileExtProfesi = ManagementUPD.FileExtIAPI, TanggalMulaiBlackList = System.DateTime.Now, TanggalAkhirBlacklist = AkhirBlacklist, StatusBlackList = Convert.ToBoolean(StatusBlacklist), Catatan = myCatatan, CreatedUser = "******", CreatedDate = System.DateTime.Now }; _repManagementBLHist.Post(ManagemenBLHist); return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Put(int id, trxManagement myData) { _repository.Put(id, myData); return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Post(trxManagement myData) { _repository.Post(myData); return(Ok(myData)); }