public JsonResult Insert(string addr = "", string tell = "", string name = "", string ceoTell = "", string ceoName = "", string id = "") { bool result = true; try { if (id == "") { CompanyModel model = new CompanyModel(); model.ComAddr = addr; model.ComCeoName = ceoName; model.ComCeoTell = ceoTell; model.ComName = name; model.ComTell = tell; new Dac_Company().CompanySave(model); } else { CompanyModel model = new CompanyModel(); model.ComAddr = addr; model.ComCeoName = ceoName; model.ComCeoTell = ceoTell; model.ComName = name; model.ComTell = tell; model.Id = ObjectId.Parse(id); new Dac_Company().CompanySave(model); } } catch(Exception ex) { result = false; } return Json(result); }
public ActionResult Save(string id = "") { CompanyModel model = new CompanyModel(); if (id != "") { model = new Dac_Company().CompanyInfoDetail(ObjectId.Parse(id)); } return View(model); }
public void CompanySave(CompanyModel company) { new MongoDacHelper("company").Save<CompanyModel>(company); }