public ActionResult SaveCodeType(IMS_CM_DMLX ent)
        {
            Func<ExtResult> saveFun = () =>
            {

                // 是否为新增
                if (ent.ID == 0)
                {
                    string filter = string.Format("LXDM = \"{0}\" ", ent.LXDM);
                    if (dalCodeType.Exists(filter))
                        throw new JsMiracleException("代码编号不得重覆");
                }
                else
                {
                    string filter = string.Format("LXDM = \"{0}\" && ID != {1} ", ent.LXDM, ent.ID);

                    if (dalCodeType.Exists(filter))
                        throw new JsMiracleException("代码编号不得重覆");
                }

                ent.CJSJ = System.DateTime.Now;
                //ent.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID;

                dalCodeType.SaveOrUpdate(ent);

                ExtResult ret = new ExtResult();
                ret.success = true;
                ret.msg = "保存成功";
                ret.parentid = ent.ID;

                return ret;
            };

            return base.Save(saveFun);

        }
 public ActionResult CreateCodeType()
 {
     var data = new IMS_CM_DMLX();
     return View("EditCodeType", data);
 }