public JsonResult insert_snapshot(int intFisYear, string strTitle, string strDesc, string strDate) { Master_Snapshot_Config obj = new Master_Snapshot_Config(); obj.FisYear = intFisYear; obj.Title = strTitle; obj.Description = strDesc; obj.Date = Convert.ToDateTime(strDate); obj.DataRefreshStatus = "updating...."; db.Master_Snapshot_Config.Add(obj); db.SaveChanges(); update_snapshot(Convert.ToDateTime(strDate), obj.Sysid); return(Json("", JsonRequestBehavior.AllowGet)); }
public JsonResult submitchanges(objsubmit obj) { if (obj.update != null) { foreach (var item in obj.update) { if (item.Sysid == 0) { Configure_RateCard row = new Configure_RateCard(); row.FisYear = item.FisYear; row.FisMonth = item.FisMonth; row.MonthlyProjectLaborRate = item.MonthlyProjectLaborRate; row.MidOrg = item.MidOrg; db.Configure_RateCard.Add(row); db.SaveChanges(); } else { Configure_RateCard row = db.Configure_RateCard.Single(x => x.Sysid == item.Sysid); row.FisYear = item.FisYear; row.FisMonth = item.FisMonth; row.MonthlyProjectLaborRate = item.MonthlyProjectLaborRate; row.MidOrg = item.MidOrg; db.SaveChanges(); } } } if (obj.delete != null) { foreach (var item in obj.delete) { if (item.Sysid != 0) { Configure_RateCard row = db.Configure_RateCard.Single(x => x.Sysid == item.Sysid); db.Configure_RateCard.Remove(row); db.SaveChanges(); } } } return(Json("data has been updated successfully", JsonRequestBehavior.AllowGet)); }
public JsonResult submitchanges(objsubmit obj) { if (obj.update != null) { foreach (var item in obj.update) { if (item.Sysid == 0) { Master_ProjectChargeBack row = new Master_ProjectChargeBack(); row.MidOrg = item.MidOrg; row.Site = item.Site; row.ProjectCharging = item.ProjectCharging; db.Master_ProjectChargeBack.Add(row); db.SaveChanges(); } else { Master_ProjectChargeBack row = db.Master_ProjectChargeBack.Single(x => x.Sysid == item.Sysid); row.MidOrg = item.MidOrg; row.Site = item.Site; row.ProjectCharging = item.ProjectCharging; db.SaveChanges(); } } } if (obj.delete != null) { foreach (var item in obj.delete) { if (item.Sysid != 0) { Master_ProjectChargeBack row = db.Master_ProjectChargeBack.Single(x => x.Sysid == item.Sysid); db.Master_ProjectChargeBack.Remove(row); db.SaveChanges(); } } } return(Json("data has been updated successfully", JsonRequestBehavior.AllowGet)); }
public JsonResult submitchanges(objsubmit obj) { if (obj.update != null) { foreach (var item in obj.update) { if (item.Sysid == 0) { Master_AOPProject row = new Master_AOPProject(); row.Name = item.Name; db.Master_AOPProject.Add(row); db.SaveChanges(); } else { Master_AOPProject row = db.Master_AOPProject.Single(x => x.Sysid == item.Sysid); row.Name = item.Name; db.SaveChanges(); } } } if (obj.delete != null) { foreach (var item in obj.delete) { if (item.Sysid != 0) { Master_AOPProject row = db.Master_AOPProject.Single(x => x.Sysid == item.Sysid); db.Master_AOPProject.Remove(row); db.SaveChanges(); } } } return(Json("data has been updated successfully", JsonRequestBehavior.AllowGet)); }