public JsonResult FeedDelete(int if_id) { IFSReportingContext db_local = new IFSReportingContext(); tblInventoryFeed inv = new tblInventoryFeed() //selecting for update { if_id = if_id }; db_local.tblInventoryFeeds.Attach(inv); db_local.tblInventoryFeeds.Remove(inv); db_local.SaveChanges(); Library.Execute("DELETE tblInventoryFeedProcess WHERE if_id = " + if_id); return(Json(new { message = "deleted" })); }
public JsonResult FeedEdit(int if_id) { IFSReportingContext db_local = new IFSReportingContext(); tblInventoryFeed inv = new tblInventoryFeed() //selecting for update { if_id = if_id, }; db_local.tblInventoryFeeds.Attach(inv); var protocol_addr = ""; if (Request["sendvia"] == "email") { protocol_addr = Request["email"]; } else if (Request["sendvia"] == "ftp") { protocol_addr = Request["ftp"]; } inv.customer_no = Request["customer_no"]; inv.filetype_requested = Request["type"]; inv.sendaaid_instead_brand_id = Request["sendid"]; inv.send_protocol = Request["sendvia"]; inv.protocol_address = protocol_addr.Replace(",", ";"); inv.sendbuyers_partno = Request["buyer"]; inv.includeheaders = Request["header"]; inv.sendtime = Request["time"].Replace(",", ";"); inv.fields = Request["field"].Replace(",", ";"); inv.sendday = Request["day"]; db_local.SaveChanges(); Library.Execute("DELETE tblInventoryFeedProcess WHERE if_id = " + if_id); string sendtime = Request["time"].Replace(",", ";"); string[] separators = { ",", ";", " " }; string[] sendtime_array = Library.Explode(sendtime, separators); AddEditSameFunction(if_id, sendtime); return(Json(new { message = "edit" })); }