コード例 #1
0
ファイル: DoorController.cs プロジェクト: sanxchen/MntApp
        public JsonResult Inouting(string cardNo, int forward)
        {
            var model = ContextFactory.ContextHelper.BaseEmployees.FirstOrDefault(c => c.IsDimission != 0 && c.CardNo.Equals(cardNo));

            if (model == null)
            {
                return(Json("error"));
            }



            if (!_doorInoutService.IsAddEntity(new DoorInout()
            {
                CardNo = cardNo,
                Forward = forward,
                EventTime = DateTime.Now,
                Record = ManageProvider.Provider.Current().UserId
            }))
            {
                return(Json("error"));
            }
            var employee = new BaseEmployee
            {
                EmpNo        = model.EmpNo,
                RealName     = model.RealName,
                DepartmentId = model.DepartmentId,
            };
            var serializer = new JavaScriptSerializer();

            return(Json(serializer.Serialize(employee)));
        }