private SECS01P002DTO GetByID(SECS01P002DTO dto) { dto.Model = _DBManger.VSMS_CONFIG_GENERAL .Where(m => m.NAME == dto.Model.NAME) .FirstOrDefault().ToNewObject(new SECS01P002Model()); return(dto); }
private SECS01P002DTO GetSystemDetail(SECS01P002DTO 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 <SECS01P002_SystemModel>(); } return(dto); }
private SECS01P002DTO GetAll(SECS01P002DTO 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 SECS01P002Model { NAME = m.NAME, SEQUENCE = m.SEQUENCE }).ToList(); return(dto); }
public SECS01P002DA() { DTO = new SECS01P002DTO(); }