You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
4.2 KiB
C#

using System;
using System.Data;
using System.Data.SqlClient;
using DSWeb.Models;
using System.Collections;
using System.Collections.Generic;
using WebSqlHelper;
namespace DSWeb.EntityDA
{
public class OpStatusDA
{
private string PARM_OP_STATUS_BSNO = "@bsno";
//private string PARM_OP_STATUS_STATUS = "@status";
//private string PARM_OP_STATUS_IS_COMP = "@is_comp";
//private string PARM_OP_STATUS_COMP_TIME = "@comp_time";
//private string PARM_OP_STATUS_COMP_OP = "@comp_op";
//private string PARM_OP_STATUS_REMARK = "@remark";
//private string PARM_OP_STATUS_INPUT_BY = "@input_by";
//private string PARM_OP_STATUS_INPUT_TIME = "@input_time";
//private string PARM_OP_STATUS_ORD_NO = "@ord_no";
//private string PARM_OP_STATUS_STATUS_OPSEAE = "@status_opseae";
private const string SQL_SELECT_OP_STATUS_BY_BSNO = " SELECT ST_ID, BSNO, STATUS, ISCOMP, COMPTIME, COMPOP, REMARK, INPUTBY, INPUTTIME, ORDNO, STATUS_OPSEAE FROM op_status WHERE BSNO = @bsno ";
#region 通过委托编号BSNO获取委托所有业务状态(op_status)
/// <summary>
/// 通过委托编号BSNO获取委托所有业务状态(op_status)
/// </summary>
/// <param name="tempBSNO">委托编号BSNO</param>
/// <returns>返回所有委托相关的业务状态实体类</returns>
public IList<OpStatusEntity> GetOpStatusByBSNO(string tempBSNO)
{
IList<OpStatusEntity> opStatusEntities = new List<OpStatusEntity>();
SqlParameter parm = new SqlParameter(PARM_OP_STATUS_BSNO, SqlDbType.VarChar, 100);
parm.Value = tempBSNO;
using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_OP_STATUS_BY_BSNO, parm))
{
try
{
while (sqlRead.Read())
{
OpStatusEntity opStatusEntity = new OpStatusEntity();
if (!sqlRead.IsDBNull(0))
{
opStatusEntity.GID = sqlRead.GetString(0);
}
if (!sqlRead.IsDBNull(1))
{
opStatusEntity.BSNO = sqlRead.GetString(1);
}
if (!sqlRead.IsDBNull(2))
{
opStatusEntity.Status = sqlRead.GetString(2);
}
if (!sqlRead.IsDBNull(3))
{
opStatusEntity.IsComplete = sqlRead.GetBoolean(3);
}
if (!sqlRead.IsDBNull(4))
{
opStatusEntity.CompleteTime = sqlRead.GetDateTime(4);
}
if (!sqlRead.IsDBNull(5))
{
opStatusEntity.CompleteOperator = sqlRead.GetString(5);
}
if (!sqlRead.IsDBNull(6))
{
opStatusEntity.Remark = sqlRead.GetString(6);
}
if (!sqlRead.IsDBNull(7))
{
opStatusEntity.InputBy = sqlRead.GetString(7);
}
if (!sqlRead.IsDBNull(8))
{
opStatusEntity.InputTime = sqlRead.GetDateTime(8);
}
if (!sqlRead.IsDBNull(9))
{
opStatusEntity.OrdNo = sqlRead.GetInt32(9);
}
if (!sqlRead.IsDBNull(10))
{
opStatusEntity.StatusOpseae = sqlRead.GetString(10);
}
opStatusEntities.Add(opStatusEntity);
}
}
catch (Exception execError)
{
throw execError;
}
}
return opStatusEntities;
}
#endregion
}
}