public JsonResult BomInsert(string unit = "", string category = "", string name = "") { bool result = true; try { CompanyModel company = new Dac_Company().CompanyInfoDetail(ObjectId.Parse(ConfigurationManager.AppSettings["COM"])); BomCategoryModel bomCategory = new Dac_Bom().BomCategorySelectById(ObjectId.Parse(category)); BomModel model = new BomModel(); model.Unit = unit; model.Company = company; model.BomName = name; ; model.BomCategory = bomCategory; new Dac_Bom().BomSave(model); } catch (Exception ex) { result = false; } return Json(result); }
public void BomSave(BomModel bom) { new MongoDacHelper("bom").Save<BomModel>(bom); }