public JsonResult InsertCompanyVsPayer(CompanyVSPayer CompanyVsPayer) { try { db.CompanyVSPayer.Add(CompanyVsPayer); CompanyVsPayer.CreateBy = AppUtils.GetLoginUserID(); CompanyVsPayer.CreateDate = AppUtils.GetDateTimeNow(); CompanyVsPayer.Status = AppUtils.TableStatusIsActive; db.SaveChanges(); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }
public ActionResult DeletePayer(int ID) { CompanyVSPayer payer = new CompanyVSPayer(); payer = db.CompanyVSPayer.Find(ID); payer.DeleteBy = AppUtils.GetLoginUserID(); payer.DeleteDate = AppUtils.GetDateTimeNow(); payer.Status = AppUtils.TableStatusIsDelete; db.Entry(payer).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); var JSON = Json(new { success = true }, JsonRequestBehavior.AllowGet); JSON.MaxJsonLength = int.MaxValue; return(JSON); }
public ActionResult UpdatePayerInformationFormPopUp(CompanyVSPayer PayerInfo) { try { CompanyVSPayer dbPayer = new CompanyVSPayer(); dbPayer = db.CompanyVSPayer.Find(PayerInfo.PayerID); dbPayer.PayerName = PayerInfo.PayerName; dbPayer.CompanyID = PayerInfo.CompanyID; dbPayer.UpdateBy = AppUtils.GetLoginUserID(); dbPayer.UpdateDate = AppUtils.GetDateTimeNow(); db.Entry(dbPayer).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); var JSON = Json(new { success = true }, JsonRequestBehavior.AllowGet); JSON.MaxJsonLength = int.MaxValue; return(JSON); } catch (Exception ex) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }