Beispiel #1
0
        public Response <UpdateOrderNoInfoUpdateRequest> OrderNoInfoUpdateByTable(UpdateOrderNoInfoUpdateRequest request)
        {
            Response <UpdateOrderNoInfoUpdateRequest> response = new Response <UpdateOrderNoInfoUpdateRequest>();

            if (request == null)
            {
                ArgumentNullException ex = new ArgumentNullException("OrderNoInfoUpdateByTable request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            try
            {
                HiltiAccessor accessor = new HiltiAccessor();
                response.Result = accessor.OrderNoInfoUpdateByTable(new UpdateOrderNoInfoUpdateRequest()
                {
                    OrderNoinfo = request.OrderNoinfo
                });
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
                response.Exception = ex;
            }

            return(response);
        }
Beispiel #2
0
        public UpdateOrderNoInfoUpdateRequest OrderNoInfoUpdateByTable(UpdateOrderNoInfoUpdateRequest Info)
        {
            using (SqlConnection conn = new SqlConnection(BaseAccessor._dataBase.ConnectionString))
            {
                DataTable  dtable = new DataTable();
                SqlCommand cmd    = new SqlCommand("Proc_Hilti_Update103OrderNo", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@OrderNoPODSOURCE", Info.OrderNoinfo);
                cmd.Parameters[0].SqlDbType = SqlDbType.Structured;
                cmd.Parameters.AddWithValue("@ERRORSOURCEVALUE", "");
                cmd.Parameters[1].Direction = ParameterDirection.Output;
                cmd.Parameters[1].SqlDbType = SqlDbType.NVarChar;
                cmd.Parameters[1].Size      = 2000;
                cmd.Parameters.AddWithValue("@ISORSUCCESS", 0);
                cmd.Parameters[2].Direction = ParameterDirection.Output;
                cmd.Parameters[2].SqlDbType = SqlDbType.Bit;
                conn.Open();

                cmd.ExecuteNonQuery();

                Info.ERRORSOURCEVALUE = cmd.Parameters[1].Value.ToString();
                Info.ISORSUCCESS      = cmd.Parameters[2].Value.ObjectToBoolean();


                return(Info);
            }
        }