标签:
public ActionResult Create(crm_CompetitiveProducts cp) { using (var db = new BaseDbContext()) { PropertyInfo[] propertys = cp.GetType().GetProperties(); int a = 0; foreach (var i in propertys) { if (i.GetValue(cp) == null) { a = a + 1; } } if (a == 0) { db.Insert<crm_CompetitiveProducts>(cp); } else { this.ShowMessage("信息不全", "录入失败"); return RedirectToAction("Create"); } return RedirectToAction("Index"); } }
标签:
原文地址:http://www.cnblogs.com/happinesshappy/p/4806580.html