예제 #1
0
        //[AuthViewPage]
        //public ActionResult ShowLocation(string wxbh)
        //{
        //    var ent = dalContainer.GetAllEntites(
        //        n => n.DQWZ.Equals(wxbh, StringComparison.CurrentCultureIgnoreCase))
        //        .FirstOrDefault();



        //    return View(ent);
        //}

        public ActionResult SaveLocation(IMS_CB_WZ entity)
        {
            Func <ExtResult> saveFun = () =>
            {
                if (!string.IsNullOrEmpty(entity.WXBH))
                {
                    var filter = string.Format("WXBH = \"{0}\" && ID != {1} ", entity.WXBH, entity.ID);

                    if (dalLocation.Exists(filter))
                    {
                        throw new JsMiracleException("位置编号不得重覆");
                    }
                }

                if (entity.ID == 0)
                {
                    entity.CJR  = CurrentUser.GetCurrentUser().UserInfo.YHID;
                    entity.CJSJ = System.DateTime.Now;
                }

                dalLocation.SaveOrUpdate(entity);
                var ret = new ExtResult();
                ret.success = true;
                return(ret);
            };

            return(base.Save(saveFun));
        }
예제 #2
0
파일: BLocation.cs 프로젝트: zhr008/ERP-1
 /// <summary>
 /// 是否存在该记录
 /// </summary>
 public bool Exists(string CODE)
 {
     return(dal.Exists(CODE));
 }