public ActionResult DeleteConfirmed(int id) { rma rma = db.rma.Find(id); db.rma.Remove(rma); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "row_id,serial,rma_number,production_finding,channel,date_requested,ictag,description")] rma rma) { if (ModelState.IsValid) { db.Entry(rma).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(rma)); }
public ActionResult Create([Bind(Include = "row_id,serial,rma_number,production_finding,channel,date_requested,ictag,description")] rma rma) { if (ModelState.IsValid) { db.rma.Add(rma); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(rma)); }
// GET: rma/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } rma rma = db.rma.Find(id); if (rma == null) { return(HttpNotFound()); } return(View(rma)); }
public JsonResult get_rma(string asset_tag) { var asset = new production_log(); var result = new rma(); string message = "RMA Info Retrieved Successfully"; try { result = (from t in db.rma where t.ictag == asset_tag select t).FirstOrDefault(); asset = (from t in db.production_log where t.ictags == asset_tag select t).FirstOrDefault(); if (result == null) { message = "No RMA Info Found with this Asset"; } } catch (Exception e) { message = e.Message; } return(Json(new { asset = asset, result = result, message = message }, JsonRequestBehavior.AllowGet)); }
public ActionResult fetch_rma() { var rma_list = search_rma(); foreach (var item in rma_list) { try { var rma = new rma(); rma.ictag = item.IC_Barcodes__c; if (!string.IsNullOrEmpty(item.IC_Barcodes__c) && item.IC_Barcodes__c.Contains("\n")) { string[] lines = item.IC_Barcodes__c.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None); for (int i = 0; i < lines.Length; i++) { rma = new rma(); var ar_temp_ictag = int.Parse(lines[i]); rma.ictag = lines[i]; rma.id = item.Id; rma.resolution_code = item.Return_Resolution__c; rma.case_number = item.CaseNumber; rma.description = item.Description; rma.channel = item.Channel__c; rma.date_requested = item.CreatedDate; rma.production_finding = item.Production_Findings__c; rma.rma_number = item.RMA_number__c; var ar_serial = (from t in db.discovery where t.ictag == ar_temp_ictag select t.serial).FirstOrDefault(); rma.serial = ar_serial; db.rma.Add(rma); db.SaveChanges(); } continue; } int temp_ictag = 0; var sucess = int.TryParse(item.IC_Barcodes__c, out temp_ictag); if (sucess == false) { continue; } rma.id = item.Id; rma.description = item.Description; rma.resolution_code = item.Return_Resolution__c; rma.channel = item.Channel__c; rma.date_requested = item.CreatedDate; rma.case_number = item.CaseNumber; rma.production_finding = item.Production_Findings__c; rma.rma_number = item.RMA_number__c; var serial = (from t in db.discovery where t.ictag == temp_ictag select t.serial).FirstOrDefault(); rma.serial = serial; db.rma.Add(rma); db.SaveChanges(); } catch { continue; } } return(View()); }