Esempio n. 1
0
        public void ActiveTiKu(TiKuUpdateModel masters)
        {
            if (masters != null)
            {
                foreach (var master in masters.List)
                {
                    var entity = tiKuRepo.Entities.FirstOrDefault(m => m.SysNo == master.SysNo);
                    if (entity != null)
                    {
                        entity.Status = master.Status;
                        entity.LastEditDate = DateTime.Now;
                        entity.LastEditUser = masters.User.UserID;
                        tiKuRepo.Update(entity);

                        var names = tiKuDetailRepo.Entities.Where(m => m.MasterSysNo == entity.SysNo).Select(m => m.ProcessName).Distinct();
                        foreach (var name in names)
                        {
                            taskService.BeginExam(new BeginExamModel()
                            {
                                ProcessName = name,
                                UserId = masters.User.UserID,
                                UserName = masters.User.UserName
                            });
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 public ApiResponse ActiveTiKu(TiKuUpdateModel model)
 {
     foreach(var item in model.List)
     {
         item.Status = (int)TiKuStatus.Actived;
     }
     tiKuService.ActiveTiKu(model);
     return ApiOk();
 }
Esempio n. 3
0
 public ApiResponse DeleteTiKu(TiKuUpdateModel model)
 {
     tiKuService.DeleteTiKu(model);
     return ApiOk();
 }
Esempio n. 4
0
 public void DeleteTiKu(TiKuUpdateModel model)
 {
     foreach (var master in model.List)
     {
         var parameter = new SqlParameter()
         {
             DbType = DbType.Int32,
             ParameterName = "@SysNo",
             Value = master.SysNo
         };
         adonetWrapper.ExecuteSqlCommand(
                 @"delete from dbo.TiKuMaster where SysNo = @SysNo;
               delete from dbo.TiKuDetail where MasterSysNo = @SysNo"
                 , parameter);
     }
 }