示例#1
0
        private MSTS03P002DTO GetAll(MSTS03P002DTO dto)
        {
            string strSQL     = @"SELECT * FROM [dbo].[VSMS_PIT_DATA] WHERE (1=1) AND KEY_ID = 'I' ";
            var    parameters = CreateParameter();

            if (!dto.Model.ISSUE_TYPE.IsNullOrEmpty())
            {
                strSQL += "AND ISSUE_TYPE like @ISSUE_TYPE";
                parameters.AddParameter("ISSUE_TYPE", dto.Model.ISSUE_TYPE);
            }

            if (!dto.Model.APP_CODE.IsNullOrEmpty())
            {
                strSQL += " AND COM_CODE = @APP_CODE";
                parameters.AddParameter("APP_CODE", dto.Model.APP_CODE);
            }

            var result = _DBMangerNoEF.ExecuteDataSet(strSQL, parameters, commandType: CommandType.Text);

            if (result.Success(dto))
            {
                dto.Models = result.OutputDataSet.Tables[0].ToList <MSTS03P002Model>();
            }

            return(dto);
        }
示例#2
0
        private MSTS03P002DTO Update(MSTS03P002DTO dto)
        {
            string SQL = @"UPDATE VSMS_PIT_DATA SET
			                    [ISSUE_TYPE] = @ISSUE_TYPE
			                    ,[REMASK] = @REMASK
			                    ,[IS_FREE] = @IS_FREE
                                ,[IS_CONS] = @IS_CONS
			                    ,[MNT_BY] = @CRET_BY
			                    ,[MNT_DATE] = @CRET_DATE
			                WHERE PIT_ID = @PIT_ID
			                AND COM_CODE = @COM_CODE"            ;

            var parameters = CreateParameter();

            parameters.AddParameter("error_code", null, ParameterDirection.Output);
            parameters.AddParameter("COM_CODE ", dto.Model.COM_CODE); //checked
            parameters.AddParameter("PIT_ID", dto.Model.PIT_ID);
            parameters.AddParameter("ISSUE_TYPE", dto.Model.ISSUE_TYPE);
            parameters.AddParameter("IS_FREE", dto.Model.IS_FREE);
            parameters.AddParameter("IS_CONS", dto.Model.IS_CONS);
            parameters.AddParameter("REMASK", dto.Model.REMASK);
            parameters.AddParameter("CRET_BY", dto.Model.CRET_BY);
            parameters.AddParameter("CRET_DATE", dto.Model.CRET_DATE);

            var result = _DBMangerNoEF.ExecuteDataSet(SQL, parameters, commandType: CommandType.Text);

            if (!result.Status)
            {
                dto.Result.IsResult  = false;
                dto.Result.ResultMsg = result.ErrorMessage;
            }
            return(dto);
        }
示例#3
0
        private MSTS03P002DTO GetByID(MSTS03P002DTO dto)
        {
            var parameters = CreateParameter();

            parameters.AddParameter("error_code", null, ParameterDirection.Output);
            parameters.AddParameter("code", null, ParameterDirection.Output);
            parameters.AddParameter("PIT_ID", dto.Model.PIT_ID);
            parameters.AddParameter("COM_CODE", dto.Model.COM_CODE);

            var result = _DBMangerNoEF.ExecuteDataSet("[bond].[SP_VSMS_PIT_DATA_004]", parameters, CommandType.StoredProcedure);

            if (!result.Status)
            {
                dto.Result.IsResult  = false;
                dto.Result.ResultMsg = result.ErrorMessage;
            }
            else
            {
                if (result.OutputData["error_code"].ToString().Trim() != "0")
                {
                    dto.Result.IsResult  = false;
                    dto.Result.ResultMsg = result.OutputData["error_code"].ToString().Trim();
                }
                else
                {
                    dto.Model          = result.OutputDataSet.Tables[0].ToObject <MSTS03P002Model>();
                    dto.Model.APP_CODE = dto.Model.COM_CODE;
                    if (result.OutputData["code"].ToString().Trim() == "0")
                    {
                        dto.Model.IS_USED = true;
                    }
                }
            }

            return(dto);
        }
示例#4
0
        private MSTS03P002DTO Insert(MSTS03P002DTO dto)
        {
            var parameters = CreateParameter();

            parameters.AddParameter("error_code", null, ParameterDirection.Output);
            parameters.AddParameter("COM_CODE ", dto.Model.APP_CODE); //checked
            parameters.AddParameter("KEY_ID", "I");
            parameters.AddParameter("PRIORITY_NAME", dto.Model.PRIORITY_NAME);
            parameters.AddParameter("ISSUE_TYPE", dto.Model.ISSUE_TYPE);
            parameters.AddParameter("RES_TYPE", dto.Model.RES_TYPE);
            parameters.AddParameter("T_RES_TYPE", dto.Model.T_RES_TYPE);
            parameters.AddParameter("RES_TIME", dto.Model.RES_TIME);
            parameters.AddParameter("T_RES_TIME", dto.Model.T_RES_TIME);
            parameters.AddParameter("IS_FREE", dto.Model.IS_FREE);
            parameters.AddParameter("IS_CONS", dto.Model.IS_CONS);
            parameters.AddParameter("REMASK", dto.Model.REMASK);
            parameters.AddParameter("CRET_BY", dto.Model.CRET_BY);
            parameters.AddParameter("CRET_DATE", dto.Model.CRET_DATE);

            var result = _DBMangerNoEF.ExecuteDataSet("[bond].[SP_VSMS_PIT_DATA_001]", parameters, CommandType.StoredProcedure);

            if (!result.Status)
            {
                dto.Result.IsResult  = false;
                dto.Result.ResultMsg = result.ErrorMessage;
            }
            else
            {
                if (result.OutputData["error_code"].ToString().Trim() != "0")
                {
                    dto.Result.IsResult  = false;
                    dto.Result.ResultMsg = result.OutputData["error_code"].ToString().Trim();
                }
            }
            return(dto);
        }
示例#5
0
 public MSTS03P002DA()
 {
     DTO = new MSTS03P002DTO();
 }