コード例 #1
0
ファイル: DutyService.cs プロジェクト: wbflike/NFineCore
        public void SubmitForm(DutyInputDto dutyInputDto, string keyValue)
        {
            Duty duty = new Duty();

            if (!string.IsNullOrEmpty(keyValue))
            {
                var id = Convert.ToInt64(keyValue);
                duty = dutyRepository.Get(id);
                AutoMapper.Mapper.Map <DutyInputDto, Duty>(dutyInputDto, duty);
                duty.LastModificationTime = DateTime.Now;
                dutyRepository.Update(duty);
            }
            else
            {
                AutoMapper.Mapper.Map <DutyInputDto, Duty>(dutyInputDto, duty);
                duty.Id            = IdWorkerHelper.GenId64();
                duty.CreationTime  = DateTime.Now;
                duty.CreatorUserId = 1;
                dutyRepository.Add(duty);
            }
        }
コード例 #2
0
ファイル: DutyController.cs プロジェクト: wbflike/NFineCore
 public ActionResult SubmitForm(DutyInputDto dutyInputDto, string keyValue)
 {
     dutyService.SubmitForm(dutyInputDto, keyValue);
     return(Success("操作成功。"));
 }