private SEC015P001DTO GetByID(SEC015P001DTO dto)
 {
     dto.Model = _DBManger.VSMS_CONFIG_GENERAL
                 .Where(m => m.NAME == dto.Model.NAME)
                 .FirstOrDefault().ToNewObject(new SEC015P001Model());
     return(dto);
 }
        private SEC015P001DTO GetSystemDetail(SEC015P001DTO dto)
        {
            var cmd        = @"select t1.SYS_CODE,
                               t1.SYS_NAME_TH,
                               t1.SYS_NAME_EN,
                               case
                                 when t2.SYS_CODE is not null then
                                  1
                                 else
                                  0
                               end SELECTED,
	                           ROW_NUMBER() OVER(order by SYS_NAME_EN,SYS_NAME_TH) ROW_NO
                          from VSMS_SYSTEM t1
                          left join (select * from VSMS_CONFIG_GENERAL where NAME = @NAME) t2
                            on t1.COM_CODE = t2.COM_CODE
                           and t1.SYS_CODE = t2.SYS_CODE
                           order by SYS_NAME_EN,SYS_NAME_TH
                        ";
            var parameters = CreateParameter();

            parameters.AddParameter("NAME", dto.Model.NAME);
            var result = _DBMangerNoEF.ExecuteDataSet(cmd, parameters, CommandType.Text);

            if (result.Success(dto))
            {
                dto.Model.SystemModels = result.OutputDataSet.Tables[0].ToList <SEC015P001_SystemModel>();
            }
            return(dto);
        }
 private SEC015P001DTO GetAll(SEC015P001DTO dto)
 {
     dto.Models = _DBManger.VSMS_CONFIG_GENERAL
                  .Where(m => ((dto.Model.NAME == null || dto.Model.NAME == string.Empty) || m.NAME.Contains(dto.Model.NAME)))
                  .OrderBy(m => new { m.NAME })
                  .Select(m => new
     {
         NAME     = m.NAME,
         SEQUENCE = m.SEQUENCE
     }).Distinct().Select(m => new SEC015P001Model {
         NAME = m.NAME, SEQUENCE = m.SEQUENCE
     }).ToList();
     return(dto);
 }
 public SEC015P001DA()
 {
     DTO = new SEC015P001DTO();
 }