Beispiel #1
0
        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);
        }
Beispiel #2
0
 public ActionResult Save(string id = "")
 {
     CompanyModel model = new CompanyModel();
     if (id != "")
     {
         model = new Dac_Company().CompanyInfoDetail(ObjectId.Parse(id));
     }
     return View(model);
 }
Beispiel #3
0
 public void CompanySave(CompanyModel company)
 {
     new MongoDacHelper("company").Save<CompanyModel>(company);
 }