예제 #1
0
        protected override bool Body(DbConnection connection)
        {
            DbCommand command = new SqlCommand();

            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "[dbo].[RP_UpdateJobApplication]";
            command.Parameters.Add(DataAcessUtils.CreateParam("@ApplicationId", DbType.Int32, _application.Id));
            command.Parameters.Add(DataAcessUtils.CreateParam("@CandidateId", DbType.Int32, _application.ApplicantId));
            command.Parameters.Add(DataAcessUtils.CreateParam("@CandidateName", DbType.String, _application.ApplicantName));
            command.Parameters.Add(DataAcessUtils.CreateParam("@State", DbType.String, _application.CurrentState));
            command.Parameters.Add(DataAcessUtils.CreateParam("@WorkflowId", DbType.Int32, _application.WorkflowId));
            DbParameter para1 = new SqlParameter();

            para1.DbType        = DbType.Int32;
            para1.ParameterName = "@outPutID";
            para1.Direction     = ParameterDirection.Output;
            command.Parameters.Add(para1);
            command.ExecuteNonQuery();
            int result = Convert.ToInt32(para1.Value);

            if (result > 0)
            {
                return(true);
            }
            return(false);
        }
        protected override string Body(System.Data.Common.DbConnection connection)
        {
            string spName    = "ExceWorkStationGetGymConnection";
            string conection = string.Empty;

            try
            {
                DbCommand command = CreateCommand(System.Data.CommandType.StoredProcedure, spName);
                command.Parameters.Add(DataAcessUtils.CreateParam("@GymCode", System.Data.DbType.String, _companyCode));
                conection = (string)command.ExecuteScalar();
                return(conection);
            }
            catch
            {
                return(string.Empty);
            }
        }